From 64b9d0ceff99afe85cc16740940574758aea61f1 Mon Sep 17 00:00:00 2001 From: Mario Romero Date: Tue, 6 Jun 2023 16:28:22 +0000 Subject: [PATCH] Update 'ALU' --- ALU.md | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/ALU.md b/ALU.md index 4037cc4..c404af9 100644 --- a/ALU.md +++ b/ALU.md @@ -1,2 +1,43 @@ -# Alu -![](https://git.1159.cl/Mario1159/RVSCC/media/branch/main/docs/figures/build/alu.svg) +# Arithmetic Logic Unit (ALU) +> *Defined in [rtl/alu.sv](https://git.1159.cl/Mario1159/RVSCC/src/branch/main/rtl/alu.sv)* + + + + + + + + + + + + + + + + + + + + + + + + + +
FigureDirectionSignal
Inputa
b
operation
Outputresult
status
​ + +The Arithmetic Logic Unit (ALU) is the combinatorial circuit in charge to perform the binary operation selected by the `operation` signal. + +`alu_opcode_t` is the enum that represent the operations, these are defined in [rv32i_defs.sv](https://git.1159.cl/Mario1159/RVSCC/src/branch/main/rtl/rv32i_defs.sv). + +The `status` bus represent the following flags: + + +| Bit index | Flag | Description | +| --------- | -------- | ------------------ | +| 0 | N | Result is negative | +| 1 | Z | Result is zero | +| 2 | C | Carry out | +| 3 | V | Overflow | +