piece of verilog code to be translated to vhdl

Status
Not open for further replies.

neocool

Member level 4
Joined
Jun 3, 2004
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,112
How would you translate this piece of code from Verilog to VHDL:

reg slck_en;
reg [4:0] count32, count1x;
.
.
.
slck_en <= (count1x == 5'b10010);

===============
The following translation does not pass syntax check:
slck_en <= to_bit(count1x = "10010");
assuming slck_en is of type bit and count1x is std_logic_vector(4 downto 0);


Thanks
neocool
 


count1x = "10010"

produces a type boolean (true/false), whereas to_bit converts from std_logic to bit.

Try

Code:
slck_en <= '1' when count1x = "10010" else '0';

instead.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…