Could you please solve #1 parts A & B. I am not really sure what I am doing for
ID: 1715243 • Letter: C
Question
Could you please solve #1 parts A & B. I am not really sure what I am doing for this.
Safari File Edit View History Bookmarks Window Help , 879 Tue 9:31 AM a 0 myasucourses.asu.edu Blackboard Learn https://myasucourses.asu.edu/bbcswebdav/pid-1... Blackboard Learn CSE100 The objective of this homework is to practice your knowledge on some simple Verilog coding. 1. Consider the following Verilog Module 3 module prbl (a,b,c,d,e,f,); 5 input [3:0] a, b, c output [7:0] d, e, f; 7 8 wire [3:0] g; 9 wire [1:0] h; 10 b); assign g = ~(a assign h= b[2:1] 12 13 14 15 16 17 18 assign d= assign e assign f= ((2(h)),c); a & (b | c); {g2,cExplanation / Answer
a)
first erroe is at line 3 there is a comma after f but it should not be there.
error free line is : module prb1(a,b,c,d,e,f);
second error is at line no. 12 here semicolon is missing at the end of line
error free line : assign h = b[2:1];
b)
a = 0111
b = 0110
c = 0101
d = {{2{h}},c}
h = b[2:1] = 2a nd 1 bit of b = 11
so h = 11
2{h} is replication operator which is 2 times h = 1111
{{2{h}},c} is conctenation operator which is conctenation of 2{h} and c = 11110101
so,d = 11110101
e = a&(b|c)
b|c is nothing but bitwise or of b and c
which is equal to 0110|0101 = 0111
a&(b|c) is bitwise and of (bitwise or if b and c)
which is equal to 0111 & 0111 = 0111
so, e = 0111
f = {g<<3,b>>2,c<<1}
g = ~(a^b)
a^b is bitwise xor of 0111 and 0110 = 0001
so g = 0001
<< is shift left operator.
g<<3 euqals to 3 times left shift of g
we have g = 0001
first shift g = 0010
simillarly after 3 shift g = 1000
b>>2,
>> is right shift
so after first shift b = 1100 and after second shift b = 1000
c<<1 is left shift of c
c<<1 = 1010
and,
f{g<<3,b>>2,c<<1}
is concatenation of shifted variables.
but g,b and c is 4 bit variable and f is 8 bit so it may give concatenation error.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.