Altera_Forum
Honored Contributor
11 years agoguarded block doesn't work
Hi there! I have an odd problem. I have to implement in VHDL a Demultiplexor 1:8, using guarded blocks. When I simulate in Active-HDL it's seems that all of the guard conditions are true so it doesn't works like a demultiplexor. here is the code:
-------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.all; entity demux is port (entry,s1,s2,s3:in bit; y: out bit_vector (7 downto 0)); end demux; ------------------------------------- architecture arch of demux is begin out0:block ( s1='0' and s2='0' and s3='0' ) begin Y(0)<=entry; end block; out1:block ( s1='1' and s2='0' and s3='0' ) begin Y(1)<=entry; end block; out2:block ( s1='0' and s2='1' and s3='0' ) begin Y(2)<=entry; end block; out3:block ( s1='1' and s2='1' and s3='0' ) begin Y(3)<=entry; end block; out4:block ( s1='0' and s2='0' and s3='1' ) begin Y(4)<=entry; end block; out5:block ( s1='1' and s2='0' and s3='1' ) begin Y(5)<=entry; end block; out6:block ( s1='0' and s2='1' and s3='1' ) begin Y(6)<=entry; end block; out7:block ( s1='1' and s2='1' and s3='1' ) begin Y(7)<=entry; end block; end arch; --------------------------------- please run it. Thank you!