{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

tutorial2

# tutorial2 - CS 230 Tutorial 2 Binary Numbers and Arithmetic...

This preview shows pages 1–31. Sign up to view the full content.

CS 230 Tutorial 2 January 17, 2011 Jonathan Rodriguez [email protected] Binary Numbers and Arithmetic

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 230 Tutorial 2 2's Complement Numbers Examples of Binary Arithmetic Miscellaneous Items Word size, Execution speed
2's Complement 8-bit binary 00000000 00000001 00000010 00000011 00000100 00000101 decimal 0 1 2 3 4 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2's Complement 8-bit binary 01111010 01111011 01111100 01111101 01111110 01111111 decimal 122 123 124 125 126 127 Sign bit
2's Complement 8-bit binary 01111111 10000000 decimal 127 -128 Sign bit (1 means it's negative!)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2's Complement 8-bit binary 11111110 11111111 00000000 00000001 00000010 decimal -2 -1 0 1 2 -X = ~X + 1 Definition of 2's Complement: Complement (flip all bits)
Addition (ex 1) 00010011 + 00000001 19 + 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 1) 00010011 + 00000001 1 19 + 1 0 Carry
Addition (ex 1) 00010011 + 00000001 1 19 + 1 20 Carry

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 1) 1 00010011 + 00000001 0 1 19 + 1 20
Addition 11 00010011 + 00000001 00 1 19 + 1 20

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 1) 11 00010011 + 00000001 100 1 19 + 1 20
Addition (ex 1) 11 00010011 + 00000001 0100 1 19 + 1 20

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 1) 11 00010011 + 00000001 10100 1 19 + 1 20
Addition (ex 1) 11 00010011 + 00000001 00010100 1 19 + 1 20

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 2) 01011101 + 00010011 93 + 19
Addition (ex 2) 1 01011101 + 00010011 0 93 + 19

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 2) 11 01011101 + 00010011 00 93 + 19
Addition (ex 2) 111 01011101 + 00010011 000 93 + 19

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Addition (ex 2) 1111 01011101 + 00010011 0000 93 + 19
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}