Download Introduction to Computer Engineering - Homework 6 Solutions | ECE 2030 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!
ECE
Homework #6: Building Blocks
Homework and Solution
1. (20 points) Design a 3-to-8 decoder using only NAND gates and inverters.
D 7 = A B C D o D = A B C o = A B C DD 11 = A B C= A B C D 2 D = A B C 2 = A B C D 3 D = A B C 3 = A B C DD 44 = A B C= A B C D 5 D = A B C 5 = A B C D 6 D = A B C 6 = A B C A B C
2. (10 points) Construct a 4-to-16 decoder with an enable input using five 2-to-4 line
decoders with enable inputs.
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
E
2 - to- 4 decoder
D 0
D 1
D 2
D 3
D 4
D 5
D 6
D 7
D 8
D 9
D 10
D 11
D 12
D 13
D 14
D 15
Inputs
A 0 A 1 A 2 A 3
A 0
A 1
A 2
A 3
4. (20 points) Design a 4-to-2 priority encoder with NOR gates and inverters such that the
inputs D0, D1, D2, and D3 have the following priorities: D1>D0>D2>D
Using the design methodology in class with this different priority these new boolean equations were
derived. The circuit uses mixed logic notation to illustrate the implementation with NOR gates.
V= D 0 +D 1 +D 2 +D 3 AA 00 = D= D 11 +D+D 22 DD 00 AA 11 = D= D 11 DD 00 D 0 D 1 D 2 D 3 D 1 D 0 D 0 D 1 D 2 A 0 A 1 V
x 1 0 0 1 0 1 x x 0 1 0 0 1 x x 1 x 0 1 1 0 0 0 0 x x 0
D 3 D 2 D 1 D 0 A 1 A 0 V
x 1 0 0 1 0 1 x x 0 1 0 0 1 x x 1 x 0 1 1 0 0 0 0 x x 0
D 3 D 2 D 1 D 0 A 1 A 0 V
00 01 11 10 00 01 11 10 D 3 D 2 D 1 D 0 x 1 00 01 11 10 00 01 11 10 D 3 D 2 D 1 D 0 1 1 1 1 1 1 AA 11 = D= D 11 DD 00 1 (^1 ) 1 x 1 AA 00 = D= D 11 +D+D 22 DD 00
Condensed Truth Table Describing Priority Encoder with D1>D0>D2>D
5. (20points) Assume that you are a cosmonaut on the Mir space station. All of a sudden a
solar flare causes a power surge that destroys a 4-to-16 decoder in one of your control
panels. You can pinpoint the defective chip because it is the only chip that has smoke
coming out of it!! Due to cut backs in the Mir budget, all you find in your toolbox is a 4-
to-1 MUX, 8-to-1 MUX, and a 4-to-2 priority encoder. First, which of these parts (only
use ONE of them) could you use to replace the decoder (and the OR gate) in the
following circuit such that the output performs the same function. Second, show the
design with the new replacement part. (Assume that you also have as many inverters as
you need)
At first you might consider the problem and say, “Hey I will quickly put in an 8-to-1 MUX to implement
the function implemented by the decoder and the OR gate.” You could draw up a truth table that looks
something like this:
Brown Green Blue Yellow Output 1 1 1 1 1
Brown Green Blue Yellow Output
Output = Yellow
Output = Yellow
Output = 0
Output = Yellow
Output = Yellow
Output = Yellow
Output = 0
Output = Yellow
This K-map clearly shows that the brown line is not needed and reveals that the designer of the original
control panel on MIR did not have an optimal design. Therefore, you decide to now use a 4-to-1 MUX
to implement the function and save your 8-to-1 MUX for more complex tasks! The implementation with
a 4-to-1 MUX is given by:
1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 0 0 0 0 Green Blue Yellow Output 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 0 0 0 0 Green Blue Yellow Output
Output = Yellow
Output = Yellow
Output = GRD
Output = Yellow
0 1 2 3 4 - to-1 MUX
Output
S 1 S 0 Green (^) Blue Yellow Black
6. (15 points)You decide that you are going to build your own digital calculator. The first
thing that you must do is design the keypad input. When a button on your keypad is
pressed, a high voltage is sent along the corresponding wire to your digital circuit. Each
keypad button provides an input into the digital circuit that you are going to design.
Assume that each key type is encoded with a 4 bit code according to the following
convention: ‘0 key’ – 0000 ‘1key’=0001; ‘2 key’=0010, ‘3 key’= 0011; ‘4 key’ = 0100;
‘5 key’ = 0101; ‘6 key’ = 0110; ‘7 key’ = 0111; ‘8 key’ =1000; ‘9 key’ = 1001; ‘+
key’=1010; ‘- key’=1011; ‘* key’=1100; ‘/ key”=1101; ‘= key’ =1110; ‘clear key’=1111.
Do you need a 4-to-1 MUX, 16-to-1 MUX, 1-to-16 DEMUX, 3-to-8 decoder, 16-to-
encoder, 4-to-16 decoder, 16-to-4 priority encoder, or an 8-to-3 encoder to produce these
codes from the basic keypad description. Once you pick one of these choices, show how
you would hook up the component to your keypad. Use the following names for the
keypad signals: 1key, 2key, 3key, 4key, 5key, 6key, 7key, 8key, 9key, pluskey,
minuskey, *key, /key, =key, clearkey.
Really a priority encoder is needed so that we can handle the condition when no key is
selected in which V (which I have label key-pressed) will be a zero!!!
20 21 2 2 23 A 0 A 1 A 2 A 3 0key 1key 2key 3key 4key 5key 6key 7key 8key 9key pluskey minuskey *key /key =key clearkey 16 - to-4 priority encoder V key-pressed