Guest
Hey there,
I'm attempting to design an ALU with a single 4-bit data line which
supplies operand A, operand B, and the mode opcode to select the
function the ALU should perform.
I'm quite new to the world of HDL and FPGA synthesis.
What I'm trying to do is to use latches to hold the values for opcode
A, opcode and the mode operand so the ALU system's Always statement
looks to the ouput of the register on the end of the latch which will
hold the mode opcode. When this register changes it will then perform
the operation specified by the mode opcode.
Are latches the correct way to do this? I am designing for minimal area
of the fpga and am using a state machine which controls the sequence of
the system.
The whole system will be clocked by a PC's parallel port for
demonstration. The order that the data will appear on the shared 4-bit
bus is: A operand, B operand then the mode opcode.
I'm trying to understand what issues may arise due to inferring
latches. I can't see any other way of doing it so that the opcodes and
the mode operand are held in the correct registers so the ALU can read
them properly.
Any help appreciated, many thanks! AL
I'm attempting to design an ALU with a single 4-bit data line which
supplies operand A, operand B, and the mode opcode to select the
function the ALU should perform.
I'm quite new to the world of HDL and FPGA synthesis.
What I'm trying to do is to use latches to hold the values for opcode
A, opcode and the mode operand so the ALU system's Always statement
looks to the ouput of the register on the end of the latch which will
hold the mode opcode. When this register changes it will then perform
the operation specified by the mode opcode.
Are latches the correct way to do this? I am designing for minimal area
of the fpga and am using a state machine which controls the sequence of
the system.
The whole system will be clocked by a PC's parallel port for
demonstration. The order that the data will appear on the shared 4-bit
bus is: A operand, B operand then the mode opcode.
I'm trying to understand what issues may arise due to inferring
latches. I can't see any other way of doing it so that the opcodes and
the mode operand are held in the correct registers so the ALU can read
them properly.
Any help appreciated, many thanks! AL