eng.amr2009
Junior Member level 3
- Joined
- Dec 21, 2009
- Messages
- 25
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Egypt
- Activity points
- 1,509
Hi all,
I have this code in VHDL which describes a generic OR-gate which is used to OR all bits of a vector:
I need to design the same generic OR-gate in verilog. I use this component intensively. I instantiate it many times with different widths.
Thanks in advance.
I have this code in VHDL which describes a generic OR-gate which is used to OR all bits of a vector:
Code:
entity var_or is
generic(
width : integer :=8
);
port(
InVector : in std_logic_vector(width-1 downto 0);
VecOred : out std_logic
);
end var_or;
architecture behav of var_or is
begin
process(InVector)
variable vResult : std_logic;
begin
vResult := '0';
for i in 0 to width-1 loop
vResult := vResult or InVectgor;
end loop;
VecOred <= vResult;
end process;
end behav;
I need to design the same generic OR-gate in verilog. I use this component intensively. I instantiate it many times with different widths.
Thanks in advance.