Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views17 pages

Lecture 4 - Data Representation-II

Uploaded by

Academic Hub
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)
16 views17 pages

Lecture 4 - Data Representation-II

Uploaded by

Academic Hub
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/ 17

1s, 2s, 9s and 10s Complement

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 41


Forming the Two's Complement
• Negative numbers are stored in two's complement
notation
• Represents the additive Inverse

Note that 00000001 + 11111111 = 00000000

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 42


Binary Subtraction
• When subtracting A – B, convert B to its two's
complement
• Add A to (–B)

00001100 00001100
– 00000011 11111101
00001001

Practice: Subtract 0101 from 1001.

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 43


Subtraction using Complements

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 44


Subtraction using Complements

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 45


Learn How To Do the Following:

• Form the two's complement of a hexadecimal integer


• Convert signed binary to decimal
• Convert signed decimal to binary
• Convert signed decimal to hexadecimal
• Convert signed hexadecimal to decimal

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 46


BCD

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 47


BCD Addition Example

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 48


Other Decimal Codes

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 49


Character Storage
• Character sets
• Standard ASCII (0 – 127)
• Extended ASCII (0 – 255)
• ANSI (0 – 255)
• Unicode (0 – 65,535)
• Null-terminated String
• Array of characters followed by a null byte
• Using the ASCII table
• back inside cover of book

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 50


Numeric Data Representation

• pure binary
• can be calculated directly
• ASCII binary
• string of digits: "01010101"
• ASCII decimal
• string of digits: "65"
• ASCII hexadecimal
• string of digits: "9C"

next: Boolean Operations

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 51


ASCII

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 52


ASCII

Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 53


Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 54
Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 55
Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 56
Irvine, Kip R. Assembly Language for Intel-Based Computers, 2003. 57

You might also like