Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
 

neocool said:
How would you translate this piece of code from Verilog to VHDL:

===============
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top