Codiode

Two's Complement Inverter

EasyLogic CircuitBuildFree

ALUs and DSP pipelines frequently need to negate signed integer values on the fly. The standard method for negating a binary number in hardware is taking its two's complement.

The circuit receives a 4-bit input A and must produce a 4-bit output Y representing the negative value of A. The two's complement operation consists of a bitwise inversion followed by an addition of one.

A[3:0] Y[3:0]
0000 0000
0001 1111
0111 1001
1000 1000

Constraints

  • Use exactly one 4-bit adder.
  • Do not instantiate a second adder or incrementer block.
  • Drive the carry-in port of the adder to perform the plus-one operation.

Topics

ArithmeticALUTwo's Complement

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.

Free to solve. A Codiode account keeps your progress.

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.

Part of Arithmetic and ALU Design

Problem 1 of 32 in the Arithmetic and ALU Design track.

Related problems

Browse all problems · Digital logic design practice problems · Learning tracks

Solve this on a laptopSend yourself the link and continue there.