Scrap Mechanic

Scrap Mechanic

Not enough ratings
32-bit ALU
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
456.961 KB
5 Feb, 2024 @ 4:27pm
1 Change Note ( view )

Subscribe to download
32-bit ALU

Description
green input, blue output
latency = 12 ticks

[Ports]
=============================
input a[31:0] // first operand
-------------------------------------------
input b[31:0] // second operand
-------------------------------------------
input op[2:0] // operation
3'b000: add/sub
3'b001: shift left
3'b010: compare (signed less than)
3'b011: compare (unsigned less than)
3'b100: xor
3'b101: shift right (logical/arithmetic)
3'b110: or
3'b111: and
-------------------------------------------
input neg // sign
1'b0: add or logical shift right
1'b1: sub or arithmetic shift right
-------------------------------------------
output q[31:0] // result
=============================