codes octal power hexadecimal ascii bcd code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14...

11
Codes Octal Power Hexadecimal ASCII BCD Code 8 3 8 2 8 1 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 A

Upload: randolf-skinner

Post on 20-Jan-2016

223 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Codes

Octal Power

Hexadecimal

ASCII BCD Code

83 82 81 80

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

0 1 2 3 4 5 6 7 8 9 A B C D E F

Page 2: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Code conversions

Decimal to Octal

Similar to Dec-to Binary:

Start dividing by 8

and build Octal figures from Remainders:

24010=3608

8 240

8 30 0

8 3 6

0 3

Page 3: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Code conversions

Binary –to-Octal

3 bits of binary could provide weight of 810, that is equivalent to Octal;i.e:

Bits: b2 b1 b0

Wts: 4 2 1

Bin: 1 1 1 710 and Octal range 0-7

Example: 100111010= 100 111 010

Octal Values: 4 7 2

Page 4: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Octal Conversion

binary: Octal:

011 010 1102

3 2 6 3268

256 128 64 32 16 8 4 2 1

3 x 82 + 2 x 81 + 6 x 80

Page 5: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Binary Addition

1110 1410

10111110

110 012510

1001

1110

101011

110110

Page 6: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Octal Addition

3458 +2368 =6038

Justification…..

3458=22910 and 2368=15810

22910+15810 = 38710

and 6038=3+6x64=38710

Page 7: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

BCD Addition

1000 + 1001 =0001 0111

Page 8: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Byte

Most computers handle and store binary data and information in groups of eight bits, so a special name is given to a string of 8 bits..Byte.

A Byte therefore always consists of eight bits data. A 32 bits data has 4 Bytes of data and similarly 128 bits of data has 16 Bytes.

Page 9: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Questions

1. What is the largest decimal value that can be represented in a binary using two bytes?

2. How many bytes are needed to represent the decimal value of 846,569 in BCD?

Page 10: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Assignment 1

1. Convert binary into decimals:1. 10110

2. 10001101

3. 100100001001

2. Convert decimal into Binary:1. 37

2. 14

3. 189

Page 11: Codes  Octal  Power  Hexadecimal  ASCII  BCD Code 8 3 8 2 8 1 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F

Assignment 1

3. What is the largest decimal value that can be represented by an eight-bit binary number?

4. Convert each Octal into Binary:1. 743

2. 256

3. 1204