CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Arithmetic

Composite ALU Datapath

HardLogic CircuitBuild

Central processing units rely on the Arithmetic Logic Unit to execute the core instruction set. This datapath combines addition, subtraction, bitwise logic, and shifting into a single functional block controlled by an instruction decode signal.

The circuit receives two 4-bit data inputs, A and B, and a 3-bit operation code Op. It must produce a 4-bit output Y corresponding to the selected operation.

| Op | Y Output | |------|------------| | 000 | A + B | | 001 | A - B | | 010 | A & B | | 011 | A | B | | 100 | A ^ B | | 101 | ~A | | 110 | A << 1 | | 111 | A >> 1 |

Constraints

  • Combinational logic only.
  • Implement addition and subtraction using a single shared adder block.
  • Route all intermediate results through a multiplexer tree controlled by Op.
  • Treat all arithmetic as 4-bit unsigned with wrap-around.
  • Shift operations are logical shifts: zero-fill the vacated bits.

Topics

aluaddermultiplexerdatapath

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Half Adder Using Only XOR and ANDEasy
  • Floating Point Exception FlagsMedium
  • 1-Bit ALU SliceMedium
  • 4-bit Carry Lookahead BlockHard
  • BCD Adder Correction BlockMedium
  • IEEE 754 Mantissa Alignment ShifterHard
  • Four-Bit Bus AdderEasy
  • Debugging Twos Complement OverflowMedium

Browse all problems · Learning tracks