gunnerunbeaten
Member level 2
-----Quiz 1
Determine whether the relational operation is syntactically correct. If yes, what
is the result (i.e., true or false)?
(a) "0110" > “1001”
(b) "0110" > "000"
(c) 2#1010# > "1010"
(d) 1010 > "1010"
case1 : assume that the data type is unsigned
case2 : assume that the data type is signed
-----Quiz 2
Determine whether the following signal assignment is syntactically correct. If not,
use the proper conversion function and type casting to correct the problem.
library ieee ;
use ieee.std_logic_1164. all ;
use ieee.numeric_std. all ;
signal s1, s2, s3, 94, s5, s6, s7: std_logic_vector(3 downto 0);
signal u1, u2, u3, u4, u5, u6, u7: unsigned(3 downto 0);
signal sg: signed(3 downto 0) ;
U1 <= 2#0001#;
u2 <= u3 and u4;
U5 <= s1 + 1;
u6 <= u3 + u4 + 3;
u7 <= (others=>'1');
s2 <= s3 + s4 -1;
s5 <= (others=>'1');
s6 <= u3 and u4;
sg <= u3 - 1;
s7 <= not sg;
------------ thanks ---------
Determine whether the relational operation is syntactically correct. If yes, what
is the result (i.e., true or false)?
(a) "0110" > “1001”
(b) "0110" > "000"
(c) 2#1010# > "1010"
(d) 1010 > "1010"
case1 : assume that the data type is unsigned
case2 : assume that the data type is signed
-----Quiz 2
Determine whether the following signal assignment is syntactically correct. If not,
use the proper conversion function and type casting to correct the problem.
library ieee ;
use ieee.std_logic_1164. all ;
use ieee.numeric_std. all ;
signal s1, s2, s3, 94, s5, s6, s7: std_logic_vector(3 downto 0);
signal u1, u2, u3, u4, u5, u6, u7: unsigned(3 downto 0);
signal sg: signed(3 downto 0) ;
U1 <= 2#0001#;
u2 <= u3 and u4;
U5 <= s1 + 1;
u6 <= u3 + u4 + 3;
u7 <= (others=>'1');
s2 <= s3 + s4 -1;
s5 <= (others=>'1');
s6 <= u3 and u4;
sg <= u3 - 1;
s7 <= not sg;
------------ thanks ---------