Home.Verilog.Digital Design.Digital Basics.Python.RF Basics.
Previous.
Next.
Custom Search

Legal Disclaimer

Chip Designing for ASIC/ FPGA Design engineers and Students
FULLCHIPDESIGN
Digital-logic Design...  Dream for many students… start learning front-end…

Legal Disclaimer

@TYH :- 4G LTE Long Term Evolution Tutorial, CloudComputing
PICS
Verilog Tutorial.
Get Noticed:- Submit your own content to be published on fullchipdesign.com

Send it to fullchip@gmail.com

Digital Basics Tutorial.

Add two signed numbers examples below.

EX1:  +7,  -6 : positive and negative number.

 

+7  -6

Step 1: Convert to 2's complement for negative numbers.

 

+7 (in Binary 4’b0111)

-6 (in Binary 4’b1110) = 1 010, save msb as sign bit and convert lower 3 bits in 2’s complement.

Step 2

Add and store the result in sum register of 5 bits wide.  

   0 111

  1 010

-----------

1 0 001

-----------

 

Step 3

Carry into signed bit and carry out of signed bit. In this scenario discard MSB msb bit. Use lower 4 bits as signed representation.  

 

Result: 4’b0 001 = 0x1 = +1

 

 

Neg Neg.
Neg > Pos.

Examples to add four possible combinations of two signed numbers.

EX1:  -7,  -6 : Two negative numbers.

EX2: +7,  -6 : Positive greater than negative.

EX3:  -7, +6 : Negative greater than positive.

EX4: +7, +6 : Two positive numbers