0% found this document useful (0 votes)
28 views14 pages

Two's Complement

This document discusses two's complement representation of numbers. It explains that two's complement allows representation of negative integers by changing the left-most bit to indicate sign. For 8-bit numbers, 128 becomes -128 but other values remain the same, with the range now from -128 to 127. It is important to recognize that the left-most bit determines if a number is positive (0) or negative (1). The document includes examples of converting between binary and decimal numbers using two's complement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views14 pages

Two's Complement

This document discusses two's complement representation of numbers. It explains that two's complement allows representation of negative integers by changing the left-most bit to indicate sign. For 8-bit numbers, 128 becomes -128 but other values remain the same, with the range now from -128 to 127. It is important to recognize that the left-most bit determines if a number is positive (0) or negative (1). The document includes examples of converting between binary and decimal numbers using two's complement.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Number System

Two’s Complement
Two’s Complement

● To allow the possibility of representing negative integers we make use of two’s


complement.
● In this section we will again assume 8-bit registers are being used.
● Only one minor change to the binary headings needs to be introduced here:
Two’s Complement

● In two’s complement the left-most bit is changed to a negative value.

● For instance, for an 8-bit number, the value 128 is now changed to -128,
but all the other headings remain the same.

● This means the new range of possible numbers


is: -128 (10000000) to +127 (01111111).
Two’s Complement

● It is important to realise when applying two’s complement to a binary


number that the left-most bit always determines the sign of the binary
number.

● A 1-value in the left-most bit indicates a negative number and a 0 -value


in the leftmost bit indicates a positive number (for example, 00110011
represents 51 and 11001111 represents -49).

-128 + 64 + 8 + 4 + 2 + 1 = -49
Writing positive binary numbers in two’s
complement format
Writing positive binary numbers in two’s
complement format
Writing positive binary numbers in two’s
complement format
Writing positive binary numbers in two’s
complement format
Writing positive binary numbers in two’s
complement format
Activity – Use your foolscap / Show your solution
Activity – Use your foolscap / Show your solution

1. Convert 39 to Binary = 00100111


-128 64 32 16 8 4 2 1

0 0 1 0 0 1 1 1

2. Convert 66 to Binary = 01000010

-128 64 32 16 8 4 2 1

0 1 0 0 0 0 1 0
Activity – Use your foolscap / Show your solution

3. Convert 88 to Binary = 01011000


-128 64 32 16 8 4 2 1

0 1 0 1 1 0 0 0

4. Convert 66 to Binary = 01100110

-128 64 32 16 8 4 2 1

0 1 1 0 0 1 1 0
Activity – Use your foolscap / Show your solution

1. Convert 01010101 to Denary = 85


-128 64 32 16 8 4 2 1

0 1 0 1 0 1 0 1

2. Convert 00110011 to Binary = 51

-128 64 32 16 8 4 2 1

0 0 1 1 0 0 1 1
Activity – Use your foolscap / Show your solution

3. Convert 01001100 to Denary = 76


-128 64 32 16 8 4 2 1

0 1 0 0 1 1 0 0

4. Convert 01111110 to Binary = 126

-128 64 32 16 8 4 2 1

0 1 1 1 1 1 1 0

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy