Signed Binary Number, Schemes and Mind Maps of Number Theory

Signed binary numbers means that both positive and negative numbers may be represented. • The most significant bit represents the sign.

Typology: Schemes and Mind Maps

2022/2023

Uploaded on 03/01/2023

bairloy
bairloy 🇺🇸

4.2

(6)

247 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Signed Binary Number
Z. Aliyazicioglu
Class #3
April 8, 2002
Introduction
Signed binary numbers means that both
positive and negative numbers may be
represented.
The most significant bit represents the sign.
Three main signed binary number codes are
used.
Sign magnitude
2s complement
1s complement
Signed Magnitude Codes
The most significant bit position is 0 for
all positive values
The most significant bit position is 1 for
all negative values
The rest of the bits represent the
absolute value
Example:
Decimal Number Sign magnitude
+15 01111
+10 01010
+8 01000
+6 00100
+3 00011
+0 00000
-0 10000
-3 10011
-5 10101
-10 11010
-
15
11111
1’s Complement Code
The most significant bit position is also used
to represent sign for 1’s complement
1’s complement of binary number N defined
as (rn-1)-N.
r is the based
n is the number of digits
1’s complement number is formed by
changing 1’s into 0’s and 0’s into 1’s.
Example:
Decimal Number 1’s complement
+15 01111
+10 01010
+8 01000
+6 00100
+3 00011
+0 00000
-0 11111
-3 11100
-5 11010
-10 10101
-15 10000
pf3

Partial preview of the text

Download Signed Binary Number and more Schemes and Mind Maps Number Theory in PDF only on Docsity!

Signed Binary Number

Z. Aliyazicioglu

Class

April 8, 2002

Introduction

  • Signed binary numbers means that both positive and negative numbers may be represented.
  • The most significant bit represents the sign.
  • Three main signed binary number codes are used. - Sign magnitude - 2s complement - 1s complement

Signed Magnitude Codes

• The most significant bit position is 0 for

all positive values

• The most significant bit position is 1 for

all negative values

• The rest of the bits represent the

absolute value

Example:

Decimal Number Sign magnitude +15 01111 +10 01010 +8 01000 +6 00100 +3 00011 +0 00000 -0 10000 -3 10011 -5 10101 -10 11010 -15 11111

1’s Complement Code

  • The most significant bit position is also used to represent sign for 1’s complement
  • 1’s complement of binary number N defined as (rn-1)-N. - r is the based - n is the number of digits
  • 1’s complement number is formed by changing 1’s into 0’s and 0’s into 1’s.

Example:

Decimal Number 1’s complement +15 01111 +10 01010 +8 01000 +6 00100 +3 00011 +0 00000 -0 11111 -3 11100 -5 11010 -10 10101 -15 10000

2’s Complement code

  • The most significant bit position is also used to represent sign for 1’s complement
  • 2’s complement of binary number N defined as (rn-1)-N+1. - r is the based - n is the number of digits
  • 2’s complement number is formed by changing 1’s into 0’s and 0’s into 1’s then adding 1.

Example:

Decimal Number 2’s complement +15 01111 +10 01010 +8 01000 +6 00100 +3 00011 +0 00000 -0 00000 -3 11101 -5 11011 -10 10110 -15 10001

• Find the 2’s complement of -

• 2’s complement of –10 10

• The 1’s complement 10101

• 2’s complement add 1 to 1’s comlement

Binary Arithmetic Using Complement

Code

Operation Add Substract X>Y X<Y (+X)+(+Y) +(X+Y) (+X)+(-Y ) +(X-Y ) -(Y -X) (-X)+(+Y) -(X-Y ) +(Y_X) (-X)+(-Y ) -(X+Y) (+X)-(+Y) +(X-Y ) -(Y -X) (+X)-(-Y ) +(X+Y) (-X)-(+Y) -(X+Y) (-X)-(-Y ) -(X-Y ) +(Y-X)

• X=0 01101 Y=0 01011

• (+X)+(+Y)