Arithmetic Logic Unit (ALU)

Arithmetic logic unit
Mathematical operation
Add sub compare increment


2 inputs (example)
CU gets instruction from ram
Tells alu operation
Adds inputs
Outputs -> Register (like ram but nearby)
The register won't save until the CU turns on the set wire
When the set wire turns on it sets the  register = to the current output
Enable wire from CU to register, makes register output what ever is saved -> connects to CPU Bus
CPU Bus connects components inside cpu has more registers with set and enable, CU turns on set for whatever register it wants to save the output to CU then turns off enable wire to clear register of ALU
Some registers for just storing info nearby CU
ALU uses temporary register for input doesnt need enable because it only outputs ot ALU
Other input from cpu bus directly stays on bus until ALU is done
CU stores instruction in instruction register only outputs to CU
Flags turn on or off based on conditions
Flag register 1 input and output per flag
Ex flags are A is larger, equal, B is larger
Instruction address register used to know where the next instruction should come from in ram
Instruction address goes to Memory address register tells ram what memory address the cpu wants
CU turns on enable ram wire ram sends data at address instruction goes to instruction register
CU control wires: keyboard, display etc


Compare
Gives flags instead of output



The combinational logic circuitry of the 74181 integrated circuit, which is a simple four-bit ALU… From wikipedia

1 bit alu from https://www.youtube.com/watch?v=WZAbZR4ef-E
  

Comments

Popular posts from this blog

Purpose