assignment1

advertisement
Assignment #1– Digital Logic
Q1[Systems]> Please give an example for a sequential system from your daily life.
Provide an I/O (input/output) description for your system and explain why your system is
sequential.
Q2[Base conversion]> Please answer the following questions by also showing the
intermediate steps of your work:

(1011001110010011)2 = ( ?
)8 = ( ?
)16
001 011 001 110 010 011 = (131623)8
1011 0011 1001 0011 = (B393)16

(734012)8 = ( ?
)16
(734012)8 = (111011100000001010)2
(0011 1011 1000 0000 1010)2 = (3B80A)16

(54??53?)8 = (??6D?E)16
//Here, every ‘?’ corresponds to a digit
(54??53?)8 = 101100??????101011???
(??6D?E)16 = ????????01101101????1110
0001 0110 0110 1101 0101 1110 = (166D5E)16
101 100 110 110 101 011 110 = (5466536)8
Q3[Two’s complement]> Please answer the following questions by also showing the
intermediate steps of your work. Every ‘?’ represents a bit. From the third bullet onwards,
the number on the left hand side of the equation is decimal:
To two’s complement a number invert all the bits and then add 1 to the result → most
significant bit 1 = negative number

What is the range (smallest and largest decimal numbers) with 10-bit
representation?
o Signed = -512 to 512
o Unsigned = 0 to 1023 (210 - 1)

?01?001? is a positive binary number whose two’s complement is ?1?01110.
What is the decimal equivalent of the first number?

-23 = (??????)2 = (101001)2
-1*25 + 0*24 + 1*23 + 0*22 + 0*21 + 1*20 = -32+8+1 = -23

-23 = (????)3 = (1011)3
-1*33 + 0*32 + 1*31 + 1*30 = - 27 + 3 + 1

-127 = (????????)2 = (10000001)2
-1*27 + 0*26 + 0*25 + 0*24 + 0*23 + 0*22 + 0*21 + 1*20 = - 128 + 1

-127 = (?????????)2 = (110000001)2
-1*28 + 1*27 + 0*26 + 0*25 + 0*24 + 0*23 + 0*22 + 0*21 + 1*20 = - 256 +
128 + 1

-1 = (?????)2 = (11111)2

-1 = (??????????????????????????????????????????????????????)2 = (all 1)2
Q4[Binary arithmetic]> Please perform the following operation by showing the
intermediate steps of your work; you need to show information regarding carry/borrow
bits, and with BCD numbers, the intermediate binary representations and conditions
being checked to produce carry/borrow:

(10110111)2 + (11001011)2 = ( ? )2
1
1
+ 1
1 1

1
0
1
0
1
1
0
0
//unsigned numbers
1
1
0
0
1
0
1
0
1
1
0
0
(00110111)2 - (10110000)2 = ( ? )2
1
1 1
1 1
1 0
//unsigned numbers
1
0
0
1
1
0
1
0
(00110111)2 + (11001011)2 = ( ? )2
1
0
+ 1
1 0

1
1
0
0
(10110000)2 - (01110111)2 = ( ? )2
1 2 2
1 0 1 1
+ 0 1 1 1
0 0 1 1

1
0
1
0
1
0
1
0
2
0
1
1
//signed numbers
1
1
0
0
1
0
1
0
1
1
0
0
1
1 1
1 1
1 0
//signed numbers
1 1 1 1
0 1 0 0 1 1 1 1
+
1
0 1 0 1 0 0 0 0
1
0 0
+ 0 1
1 0
1
1 1 0 1 1 1
0 1 0 0 0 0
0 0 0 1 1 1
Overflow

(1101)2 x (0101)2 = ( ? )2

(4624)BCD + (9318)BCD = ( 13942 )BCD
0
+ 1
1
+ 0
1 0
1
0
1
1
0
0
0
0
1
1
//unsigned numbers
0
1
1
0
1
1
0 1 1 0
+ 0 0 1 1
1 0 0 1
1
0 0
+ 0 0
0 1
1
1
0
0
1
0
1
0
0
+ 1
1
+ 0
0
1
0
1
1
0
0
0
0
1
1
0
0
0
0
0
1 3 9 4 2
BCD addition → subtracting 10 is same as adding 6 modulo 16 → carry gives us
the 2nd digit of the addition

(9318)BCD - (4624)BCD = ( ? )BCD
9’s complement of subtrahend: 9999 – 4624 = 5375
1
9 3 1 8
+ 5 3 7 5
1 4 6 9 3
+
1
4 6 9 4
Download