Assignment_1_24_Detailed_Solution
Assignment_1_24_Detailed_Solution
2. Which of the following syntax is correct for the representation of numbers in Verilog
(A) <size>’<radix><value>
(B) <size><radix>’<value>
(C) <radix>’<size><value>
(D) <value>’<radix><size>
Answer: A
Detailed Solution: Refer @ 16:45 https://youtu.be/gaESpBmDsoQ?t=1005
5. What is the binary value of p in the Verilog operation 5’bz0x10 !== 5’bz0010=p?
(A) 0
(B) 1
(C) z
(D) x
Answer: B
Detailed Solution: a !== b represents a is not equal to b (case inequality). So the value
of p is 1.
6. Which of the following is FALSE?
(A) 5'bz0x11 !== 5'bz0011 = 1
(B) 5'bx0x11 !== 5'bx0001 = 1
(C) 5'bx0x11 === 5'bx0011 = 0
(D) 5 == 5 = 1
Answer: C
Detailed Solution: ===, !== are case equality operators where operands are compared
bit by bit including x and z. Hence, 4'bx0x1 === 4'bx001 is FALSE(= 0).