Docsity

Conversions: Decimal to Binary, Binary to Decimal, Binary to Hex, Hex to Decimal, Study notes of Computer Architecture and Organization

Toggle sidebar
bg1
1
A Quick Review
zDecimal to binary
zBinary to decimal
zBinary to hexadecimal
zHexadecimal to binary
zHexadecimal to Decimal
zBinary addition
zBinary subtraction
zBinary shift
Decimal to Binary
z146d = ????????b
z146/2 = 73 Remainder = 0 LSB (73)
z73/2 = 36 Remainder = 1 (36.5)
z36/2 = 18 Remainder = 0 (18)
z18/2 = 9 Remainder = 0 (9)
z9/2 = 4 Remainder = 1 (4.5)
z4/2 = 2 Remainder = 0 (2)
z2/2 = 1 Remainder = 0 (1)
z1/2 = 0 Remainder = 1 MSB (0.5)
z146d = 10010010b
pf3
pf4
pf5

Partial preview of the text

Download Conversions: Decimal to Binary, Binary to Decimal, Binary to Hex, Hex to Decimal and more Study notes Computer Architecture and Organization in PDF only on Docsity!

A Quick Review

zDecimal to binary

zBinary to decimal

zBinary to hexadecimal

zHexadecimal to binary

zHexadecimal to Decimal

zBinary addition

zBinary subtraction

zBinary shift

Decimal to Binary

z 146d = ????????b z 146/2 = 73 Remainder = 0 LSB (73) z 73/2 = 36 Remainder = 1 (36.5) z 36/2 = 18 Remainder = 0 (18) z 18/2 = 9 Remainder = 0 (9) z 9/2 = 4 Remainder = 1 (4.5) z 4/2 = 2 Remainder = 0 (2) z 2/2 = 1 Remainder = 0 (1) z 1/2 = 0 Remainder = 1 MSB (0.5) z 146d = 10010010b

Binary to Decimal

z10010010b = ???d

zWhich positions have ones?

{7, 4 and 1

z12^7 + 12^4 + 1*2^1 = 128 + 16 + 2 = 146

Binary to Hexadecimal

z10010010b = ??h

zSplit binary string into 4 bit components

z1001b = 9d = 9h

z0010b = 2d = 2h

zConcatenate the hex digits

z10010010b = 92h

Binary Addition

z 1+1 = 10 (carry 1)

z 0+1 = 1

z 1+0 = 1

z 0+0 = 0

z 1+1+1=11 (carry 1)

Binary Subtraction

z 1-1 = 0

z 1-0 = 1

z 0-1 = 1 (borrow)

z 0-0 = 0

z *) borrow

Multiplication and Division by Shifting

(Optimization trick)

z0001010b = 10d

zShift left (multiply by 2)

{0010100b = 20d {0101000b = 40d

zShift right (divide with 2)

{0000101b = 5d (remainder 0 shifted out) {0000010b = 2d (remainder 1 shifted out)

Calculating Two Complement

z58d = 00111010b

z-58d = TC(58d) = TC(00111010b) =?

zOne complement

{OC(00111010b) = 11000101b

zAdd one

z-58d = 11000110b 11000110

Two Complement Addition

z48d + (-58d) = -10d

z48d = 00110000b

z-58d = TC(58d) = 11000110b

z-10d = TC(10d) = 11110110b