I
illogical
Guest
Relative new guy to VHDL here, trying to get my head around it (coming
from a procedural/OO background).
Trying to implement a basic ALU, 5 operations with 5 individual input
gates to indicate they are selected.
I was aiming to use 5 PROCESS statements to 'trigger' when one of the
bits is set high, is this feasible in VHDL? (example below).
architecture Behavioral of alu is
begin
do_add: process (data_a, data_b, op_add) -- add
begin
if op_add = '1' then
y <= data_a + data_b;
end if; end process do_add;
do_sub: process (data_a, data_b, op_comp) -- complement
begin
if op_sub = '1' then
y <= not(data_a)
end if;
end process do_sub;
... and so on.
Or is it 'better practice' to do with multiple if then else statements?
The result is a combinational circuit ether way, but I'm unfamiliar with
the ins and outs of VHDL just yet.
P.S Can't change the way the operation is specified, i.e. must 5
seperate signals rather than one "op code" signal.
from a procedural/OO background).
Trying to implement a basic ALU, 5 operations with 5 individual input
gates to indicate they are selected.
I was aiming to use 5 PROCESS statements to 'trigger' when one of the
bits is set high, is this feasible in VHDL? (example below).
architecture Behavioral of alu is
begin
do_add: process (data_a, data_b, op_add) -- add
begin
if op_add = '1' then
y <= data_a + data_b;
end if; end process do_add;
do_sub: process (data_a, data_b, op_comp) -- complement
begin
if op_sub = '1' then
y <= not(data_a)
end if;
end process do_sub;
... and so on.
Or is it 'better practice' to do with multiple if then else statements?
The result is a combinational circuit ether way, but I'm unfamiliar with
the ins and outs of VHDL just yet.
P.S Can't change the way the operation is specified, i.e. must 5
seperate signals rather than one "op code" signal.