Assignment Questions:
Question 1
(a) Convert the 345 decimal number to
- Binary
- Octal
- Hexadecimal
(b) Calculate the following:
- 4568 + 7468
- 10112 * 1012
- F6B16 + BCE16
Question 2
- Given that =. +. (. + )
i) Construct a logic circuit diagram for the above Boolean expression.
ii) Construct a truth table for the above Boolean expression.
iii) Simplify the Boolean expression of the part (i).
Question 3
- The wavelength λ and frequency f of a sound wave are related by λ f = v, where v is the speed of the wave. Musicians refer to different wavelengths or frequencies by their notes (A-G). Use the information in the following table to plot the frequency on the vertical axis and 1/λ on the horizontal axis.
- A block with mass M = 2.0kg slides around a vertical circular track with a radius of R. Assume that friction between the block and the track is negligible.
What is the minimum speed the block must have at the top of the track in order to ensure that it does not leave the track at the top?
Write a Matlab program that prompts the user to input the Radius of the circular track and then calculate and display the minimum speed of the block.
You can use the following formula to calculate the minimum speed (v).
G is the gravity = 9.8 m/s2
Question 4
(a) Write MatLab solution for the following conversion:
Option | Conversion |
DR | Degrees to Radian |
RD | Radian to Degree |
other | Error mag |
Your solution must prompt the user to input the option (DR or RD). If the option is DR, then ask for angle in degrees and the program displays the equivalent radians. If the option is RD then ask for angle in radians then the program displays the equivalent degrees.
Your program should able to accept both scalar and matrix input.
The script should keep running until no number is provided to convert.
[The function is empty will be useful here]
(Hint : degrees = radians * 180 / pi
Radians = degrees * pi / 180 )
Question 5
- Write a Matlab script to calculate the Sum for the following expression:
- The matrices A, B, C, D are shown below:
Question 6
An electronics shop has announced the following seasonal discounts on the purchase of certain items.
Purchase Amount | Discount on Laptop | Discount on Desktop PC | |
0–250 | 0.0% | 5.0% | |
251-570 | 5.0% | 7.6% | |
571-1000 | 7.5% | 10.0% | |
More than 1000 | 10.0% | 15.0% |
Write a program based on the above criteria to input name, address, amount of purchase, and type of purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a customer along with his name and address.
Discount = (discount rate/100)* amount of purchase
Net amount = amount of purchase – discount