





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Prob 1 (15pts)
Prob 2 (35pts)
Prob 3 (15pts)
Prob 4 (35pts)
TOTAL (100pts)
a) (6pts) (-37) + (+58) in signed magnitude
1 0 1 0 0 1 0 1 (-37)
0 0 0 1 0 1 0 1 (+21)
37 in binary = 00100101, 58 in binary = 00111010
00100101 (37)
11101011 (end borrow, so correction needed) 00010101 (2’s complement correction) 00010101 (get the opposite sign of 1 st^ operand) b) (6pts) (-58) + (-37) in 1’s complement (do not use 2’s complement)
1 1 0 0 0 1 0 1 (-58)
1 0 1 0 0 0 0 0 (-95)
110011111 (end carry, so correction needed) 10011111
10100000 (-95)
a) (5pts) build the corresponding truth table.
A 1 A 0 B 1 B 0 A > B A = B A < B 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 1 0
b) (15pts) design the comparator using 3x8 decoders and logic gates.
2-bit comparator
c) (15pts) design the comparator using three 4x1 multiplexers and logic gates.
The controller produces two output signals: T to dispense a ticket, and R to reject the inserted coin.
a) (9pts) draw the corresponding state diagram. You should have 4 states only, and your arc label should follow BA / TR format.
no coin
nickel
dime bad coin
b) (9pts) build the corresponding state table. Name your state bits P and Q for MSB and LSB, respectively.
Pres In Next Out P Q B A P Q T R 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 1 1 0 0 0 1 1 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 0 1
c) (9pts) derive the simplified equations for D flip-flops and outputs using K-maps. Use BA for rows and PQ for columns.
K-map for Q
K-map for P
K-map for R
K-map for T