You are on page 1of 3

National University of Computer & Emerging Sciences

Computer Logic & Design – TC&TD – Fall 2006


Quiz-1B Solution

Answer the following questions only in the provided space Time allowed: 30 min
Use back of the page for rough work – no opening of notebooks or texts! Maximum points: 35

1. What is a DAC used for? Give an example. 2 pts


Digital to analog Converter is used for converting a digital signal to analog signal. Example may include any device

which may convert digital signal into analog.

2. What is the binary equivalent of (0.67)10 evaluated to the 3rd binary bit? 2 pts

0.67 * 2 = 1.34, 0.34 * 2 = 0.68, 0.68 * 2 = 1.36


The answer is 0.101 to 3rd binary bit

3. Determine the 1’s complement of negative (5B3)16 in binary form. Assume # is 12 bit long 3 pts

(5B3) 16 = (010110110011)2 therefore - (5B3) 16 = (101001001100)2 (1’s Complement)


Its 1’s complement is the same as the original number. So, answer is 010110110011

4. Determine the decimal value of (101001)2 (2’s complement form)? 2 pts

The number is negative since the MSB is one and the number is in 2’s Complement.
Taking the 2’s Complement we get (010111)2 = (23)10. But the original number is
negative so we have -23

5. Express -0.1011101 x 226 as a Single Precision Floating Point binary # per IEEE 754 format. 2 pts

This is a positive number, therefore sign bit is 0. Arranging the number we get
-1.011101 x 225. Exponent is equal to 127+25=152 (152)10 = (10011000)2.
The number is 1|10011000|000000000000000000

6. Perform the following calculation using 2’s complement arithmetic. 2 pts


Hint: complement the number first.

0 1 0 1 0 1 1 0 (2’s complement form)


- 0 0 1 1 1 0 1 1 (2’s complement form)
First take the complement of the second number
1 1 0 1 0 1 1 1 now add this with the first
+ 0 1 0 1 1 1 0 0
1 0 0 1 1 0 0 1 1 discard carry
7. Multiply 4-bit 2’s complement #s (0011)2 with (1010)2 using 2’s complement arithmetic. 3 pts
First we note the answer will be negative. Since its easier to work with less bits, we
take 2’s Complement of the multiplier (1010)2 = (0110)2 = (6)10
0110 3
x 0011 x -6
0110 -18
+ 0110x
010010
Now taking the 2’c Complement of the answer we get 101110

8. Identify the problem with the below addition? Overflow 2 pts

0 1 0 1 (2’s complement form)

+ 0 0 1 1 (2’s complement form)

1 0 0 0 (2’s complement form)

9. For a 9-bit 2’s complement form, what is the range of integer numbers that can be represented? 2pts

Range for a n-bit signed number is given by -2n-1 to +2n-1-1


So n=9 we get -29-1 to +29-1-1 = -256 to +255

10. Perform the following operation on the two octal numbers: 2 pts

5 7 3 3
- 1 6 7 5
4 0 3 6
Alternate method: First take the 2’s Complement of the number (1675)8
7777-1675+1 = (6103)8
Now add the first number in the 2’s Complement of the second number.
5733
+6103
1 4 0 3 6 discard carry

11. Perform the following subtraction 2 pts


(9 2 B 5) 16
- (0 2 A C) 16
9 0 0 9
Alternate method: First take the 2’s Complement of the number (02AC)16
FFFF-02AC+1 = (FD54)16
Now add the first number in the 2’s Complement of the second number.
92B5
+FD54
1 9 0 0 9 discard carry
12. Perform the following BCD addition showing all steps. 2 pts

0 1 1 1 1 0 0 1

+ 0 1 1 0 0 1 0 1
1 0 1 1 1 1 1 1
1 0 1 1 0 adding 6 because
Number is > 9
1 1 0 0 0 1 0 1
0 1 1 0 adding 6 because number >9
1 0 0 1 0 0 1 0 1 Answer

13. In an 8-bit digital system being considered, a designer is facing constraints in allocating an additional bit for
odd parity in his design. However, he knows realistically for all his inputs, the 8th MSB bit will never be
used in the given system. So, he decides to implement the unused 8th bit as odd parity bit. Can you help him
determine the parity bit for the following set of inputs: 2 pts
0 1 0 1 0 1 1 1

1 0 1 1 1 0 0 1

In the above system, will the designer be able to detect single digit errors? Why? 2 pts

Yes , parity bit does not match for the number

14. What is a Gray code? 2 pts

A gray code is an un-weighted code. It changes a single bit from one code to the next in sequence.

15. Which of the following are weighted codes: 3 pts


Gray Code X
Extended ASCII Code X
BCD Code √

You might also like