{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SOEN228_11w_week9supp

# SOEN228_11w_week9supp - SOEN229 11w Week 9 supplemental...

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

SOEN229 11w Week 9 supplemental NASM arithmetic

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

View Full Document
Data Representation Numbering Systems Decimal System the number 123 represents: 1*10 2 + 2*10 1 + 3*10 0 or 100+20+3 The Binary Numbering System the binary value 11001010 2 represents: 1*2 7 + 1*2 6 + 0*2 5 + 0*2 4 + 1*2 3 +
Conversions convert decimal to binary Successive division by 2, build the binary by concatenating the remainders 202/2 = 101, remainder is 0 2 0 101/2=50, remainder is 1 2 1 50/2=25 remainder is 0 2 2 25/2=12 remainder is 1 2 3 12/2=6 remainder is 0 2 4 6/2=3 remainder is 0 2 5 3/2=1 remainder is 1 2 6 1/2 =0 remainder is 1 2 7 Result = 1100101

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

View Full Document
Hexadecimal Shorthand notation for binary, 4 bits at a time 11001010 can be represented as 1100 1010 = CAh Note that 4 bits give 16 combinations, from 0 to 15. In Hex, we refer to 10 as A, 11 as B, etc. 1010 = 10 in decimal = A in hex 1011 = 11 in decimal = B in hex 1100 = 12 in decimal = C in hex 1101 = 13 in decimal = D in hex 1110 = 14 in decimal = E in hex 1111 = 15 in decimal = F in hex
Conversion to decimal Binary to decimal Multiplication by successive powers of 2 11001010 1*2 7 + 1*2 6 + 0*2 5 + 0*2 4 + 1*2 3 + 0*2 2 + 1*2 1 + 0*2 0 » = 128 + 64 + 8 + 2 » = 202 10 (as in previous slide) Hex to decimal Multiplication by successive powers of 16. For example, the number 1234 16 is equal to: » 1 * 16 3 + 2 * 16 2 + 3 * 16 1 + 4 * 16 0 » or » 4096 + 512 + 48 + 4 = 4660 10 .

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

View Full Document
Unsigned and signed integers in binary Unsigned integers are all positive numbers
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}