在行为VHDL中(使用2个并发进程)描述MIPS ALU,该MIPS ALU支持带符号算术和最多16个操作/功能,如图1所示。ALU具有以下接口:
• Generics
- ALU data bits (n_bits_alu with default value of 32 bits)
- Total number of supported operations/functions (n_functions_alu with default value of 16 functions)
• Inputs
- First input operand (A -> n_bits_alu bits = 32 bits)
- Second input operand (B -> n_bits_alu bits = 32 bits)
- ALU control (ALUControl -> [log2 (n_functions_alu)] bits)
• Outputs
- Result output operand (C -> n_bits_alu bits = 32 bits)
- Zero flag (zero -> 1 bit)
- Overflow flag (overflow -> 1 bit)
• In Vivado
- Create a blank project
- Add design and simulation source files
- Run behavioral simulation
- Your waveform configuration should be identical to the provided waveform snapshot, see Figure 2.