{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw21_SLN

# hw21_SLN - ECE 211 HW 21 SOLUTIONS p 1/4...

This preview shows pages 1–4. Sign up to view the full content.

ECE 211 HW 21 SOLUTIONS p 1/4 //home/vdimitrov/25330/f4ed2a36fb2691bf7c9933cc6e38891de519c817.doc HW Set 21 SOLUTIONS 1. The module below uses an always block, but the module describes a combinational circuit. Write a logic expression for f. (Note that the two variables in the p bus are denoted by p[1], [0].) module pick_one(p,a,b,c,d,f); input [1:0] p; input a,b,c,d; output f; reg f; always @(*) case (p) 2'b00: f <= a; 2'b01: f <= b; 2'b10: f <= c; 2'b11: f <= d; endcase endmodule Solution: f = !p[1] & !p[0] & a | !p[1] & p[0] & b | p[1] & !p[0] & c | p[1] & p[0] & d ;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ECE 211 HW 21 SOLUTIONS p 2/4 2. Rewrite the pick_one module using if, else procedures instead of the case procedure. A Solution: module pick_one_2(p,a,b,c,d,f); input [1:0] p; input a,b,c,d; output f; reg f; always @(*) if (p == 2'b00) f <= a; else if (p == 2'b01) f <= b; else if (p == 2'b10) f <= c; else if (p == 2'b11) f <= d; endmodule
ECE 211 HW 21 SOLUTIONS p 3/4 3. Each module below decsribes a D rising-edge triggered flip-flop with a reset input R. Describe in words the difference between the two flip-flops. module D_FF_1 (D,R,clock,Q); input D, R, clock;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

hw21_SLN - ECE 211 HW 21 SOLUTIONS p 1/4...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online