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

ALU Flag Evaluation Branch Logic

HardLogic CircuitBuild

Instruction decode units in microprocessors rely on ALU status flags to determine whether conditional branches should be taken. The branch unit evaluates combinations of these flags to resolve complex conditions like the signed "Greater Than Or Equal" (BGE) instruction.

Construct the branch evaluation logic for a BGE instruction. The circuit receives the Zero (Z), Negative (N), and Overflow (V) flags from an ALU that just evaluated A - B. The output Y must assert if A >= B in signed two's complement arithmetic.

| Z | N | V | Y | |-----|-----|-----|-----| | 0 | 0 | 0 | 1 | | 0 | 0 | 1 | 0 | | 0 | 1 | 0 | 0 | | 0 | 1 | 1 | 1 | | 1 | 0 | 0 | 1 | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 0 | | 1 | 1 | 1 | 1 |

Constraints

  • Combinational logic only.
  • Do not use high-level arithmetic or comparison blocks.
  • Drive the output Y strictly based on the provided truth table.

Topics

ALUCombinational LogicBranch Logic

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