Docsity

EE 231 Homework Assignment 4: Logic Gates Solutions - Prof. William Rison, Assignments of Digital Electronics

Toggle sidebar
bg1
EE 231
Homework Assignment 4
Due Sep. 26, 2008
Problem 3.9 (a) (c) (e)1.
Problem 3.10 (a) (c)2.
Problem 3.11 (b)3.
Problem 3.12 (a) (c)4.
Problem 3.15 (a) (c)5.
Problem 3.186.
Problem 3.287.
Problem 3.31 (e) (f)8.
Problem 3.32 (e) (f)9.
Problem 3.3710.
Bill Rison, <[email protected] >
EE 231 Homework Assignment #4
http://www.ee.nmt.edu/~rison/ee231/hw/hw04.html
1 of 1
9/28/2008 3:37 PM
pf3
pf4
pf5
pf8

Partial preview of the text

Download EE 231 Homework Assignment 4: Logic Gates Solutions - Prof. William Rison and more Assignments Digital Electronics in PDF only on Docsity!

EE 231

Homework Assignment 4

Due Sep. 26, 2008

  1. Problem 3.9 (a) (c) (e)
  2. Problem 3.10 (a) (c)
  3. Problem 3.11 (b)
  4. Problem 3.12 (a) (c)
  5. Problem 3.15 (a) (c)
  6. Problem 3.
  7. Problem 3.
  8. Problem 3.31 (e) (f)
  9. Problem 3.32 (e) (f)
  10. Problem 3. Bill Rison, <[email protected] >

EE 231 Homework Assignment #4 http://www.ee.nmt.edu/~rison/ee231/hw/hw04.html 1 of 1 9/28/2008 3:37 PM

hw04_soln.v Page 1

// 3.

// (e) Note that the threeโˆ’input gate is DeMorgan representation of a NOR gate

module Fig_3_26_gates (F, A, B, C, D, E); output F; input A, B, C, D, E; wire w1, w2, E_bar;

not (E_bar, E); nor (w1, A, B); nor (w2, C, D); nor (F, w1, w2, E_bar); endmodule

// (f) Note that all gates are NOR gates

module Fig_3_27_gates (F, A, B, C, D); output F; input A, B, C, D; wire w1, w2, w3, w4, A_bar, B_bar, D_bar;

not (A_bar, A); not (B_bar, B); not (D_bar, D); nor (w1, A_bar, B); nor (w2, A, B_Bar); nor (w3, C, D_bar); nor (w4, w1, w2); nor (F, w4, w3); endmodule

// โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’โˆ’

// 3.

// (e)

module Fig_3_26_CA (F, A, B, C, D, E); output F; input A, B, C, D, E;

// (a) To get A NOR B: ~(A + B) // (b) To get C NOR D: ~(C + D) // (c) Finally, take the NOR of (a) and (b) with E'

assign F = ~( ~(A + B) + ~(C + D) + ~E );

// Another way, from the Boolean equation: // assign F = (A + B) & (C + D) & E;

endmodule

// (f)

module Fig_3_27_CA (F, A, B, C, D); output F; input A, B, C, D;

// (a) First, get A' NOR B: ~(~A + B) // (b) Then get A NOR B': ~(A + ~B) // (c) NOR (b) and (c) together: ~( ~(~A + B) + ~(A + ~B)) // (d) Get C NOR D': ~(C + ~D) // (e) Finally, NOR (c) and (d) together:

assign F = ~( ~( ~(~A + B) + ~(A + ~B)) + ~(C + ~D));

// It is hard to read the above gateโˆ’level translation. // It is easier to write directly from the Boolean equation // // assign F = ((A & ~B) + (~A & B)) & (C + ~D);

endmodule

hw04_soln.v Page 2

// A primitive has one output, and is defined by a truth table. // The circuit will have an output of 1 when three or four of the inputs // are 1; otherwise, the output will be 0.

UDP_Majority_4 (y, a, b, c, d); output y; input a, b, c, d; table // a b c d : y 0 0 0 0 : 0 ; 0 0 0 1 : 0 ; 0 0 1 0 : 0 ; 0 0 1 1 : 0 ; 0 1 0 0 : 0 ; 0 1 0 1 : 0 ; 0 1 1 0 : 0 ; 0 1 1 1 : 1 ; 1 0 0 0 : 0 ; 1 0 0 1 : 0 ; 1 0 1 0 : 0 ; 1 0 1 1 : 0 ; 1 1 0 0 : 0 ; 1 1 0 1 : 0 ; 1 1 1 0 : 1 ; 1 1 1 1 : 1 ; endtable endprimitive