What is the decimal equivalent of x in the following code? [code]SIGNAL x : OUT SIGNED (3 DOWNTO 0 ); x <= “1101”;[/code]

Thanh Thảo

New member
What is the decimal equivalent of x in the following code?
Code:
SIGNAL x : OUT SIGNED (3 DOWNTO 0 );
x <= “1101”;
A. -5
B. 5
C. -3
D. -14
 
Answer: c
Explanation: Signed numbers always have first bit representing the sign of the number which is one for the negative and zero for the positive. Also, signed number is represented in 2’s complement form. Therefore, the given number is -3.
 

Tìm kiếm

Back
Top