Forum Discussion
Altera_Forum
Honored Contributor
17 years agohelp understanding code
What is "zero" doing in this program.
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
ENTITY alu8bit IS
port(a, b : in std_logic_vector(7 downto 0); -- a and b are buss...
Altera_Forum
Honored Contributor
17 years agoIt looks like a simple ALU.
op is the opcode. SO when op is 000 the ALU performs a logical AND of a and b, When Op is 001 it performs a logical OR etc The result of the operation is stored in the variable temp. The signal zero is one when the result in temp is 0. i.e. it indicates that the result of the requested operation (AND, OR, +, -) etc is zero. When you say you always get the result of b, what value is a?