351_quiz3_s

351_quiz3_s - (NOTE: 1 point off if that last sentence...

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

ECE 351 Quiz #3 Questions 1, 2 and 4 are worth two points each. Question 3 is worth 4 points. 1. What are the two ways of assigning a value to a net variable? Drive it with a module output or with a continuous assignment statement. 2. What does the following partial Verilog program do? wire [0:1] b; wire [0:5] c,d; wire [0:3] a; assign {a,b} = c &d; It computes the bit-wise AND of two 6-bit variables. The 4 most significant bits are assigned to the variable ‘a’ and the remaining bits to the variable ‘b’. Both ‘a’ and ‘b’ are updated whenever the variables ‘c’ or ‘d’ are changed.

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.

Unformatted text preview: (NOTE: 1 point off if that last sentence isn’t there.) 3. Draw a schematic of the circuit produced by the following code: input a,b; output y; wire p,q; assign p = a | b; assign q = a ^ b; assign y = ~(q & p) ; 4. What does the following partial Verilog program do? always @(posedge A or posedge B) Y <= A << 2; Whenever a positive edge is seen on the variables ‘A’ or ‘B’, the value of ‘Y’ is updated with the value of ‘A’ left-shifted by 2 bits....
View Full Document

This note was uploaded on 10/16/2011 for the course ECE 351 taught by Professor Greenwood during the Spring '11 term at Portland State.

Page1 / 2

351_quiz3_s - (NOTE: 1 point off if that last sentence...

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

View Full Document
Ask a homework question - tutors are online