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.

convert vhdl function in to verilog function

Status
Not open for further replies.

Alka Arora

Newbie level 6
Joined
Jan 30, 2009
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,354
Hi ,

I need to convert this VHDL function in to verilog:Could you please help.


--------------------------------------------------------------------------------------------------
FUNCTION EXT (ARGUMENT: STD_LOGIC_VECTOR; SIZE: NATURAL) RETURN STD_LOGIC_VECTOR IS
VARIABLE RS: STD_LOGIC_VECTOR (SIZE-1 DOWNTO 0);
VARIABLE TMP: STD_LOGIC_VECTOR (ARGUMENT'length-1 DOWNTO 0);
CONSTANT MSB: natural := min(ARGUMENT'length, SIZE) - 1;
BEGIN
TMP := TO_X01 (ARGUMENT);
RS := (others => '0');
RS(MSB DOWNTO 0) := TMP(MSB DOWNTO 0);
RETURN RS;
END;

Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top