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

Arithmetic Right Shifter

EasyLogic CircuitBuild

Two's complement arithmetic requires specialized shift operations to maintain negative values. An arithmetic right shift divides a signed integer by two by duplicating the sign bit as it shifts the bus.

Route a 4-bit input A to a 4-bit output Y such that the value is shifted right by one bit position. The most significant bit of A must be duplicated to preserve the sign of the number.

| A | Y | |-----|-----| | 0000 | 0000 | | 0001 | 0000 | | 0010 | 0001 | | 0011 | 0001 | | 0100 | 0010 | | 0101 | 0010 | | 0110 | 0011 | | 0111 | 0011 | | 1000 | 1100 | | 1001 | 1100 | | 1010 | 1101 | | 1011 | 1101 | | 1100 | 1110 | | 1101 | 1110 | | 1110 | 1111 | | 1111 | 1111 |

Constraints

  • Combinational logic only.
  • Do not use logic gates.
  • Implement the shift using only wire routing, splitters, and combiners.

Topics

arithmeticshiftdatapathrouting

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