topic 1 digital technique numbering system

26
Malaysian Institute of Aviation Technology DIGITAL TECH (MECH) AKD 21102 CHAPTER 1 NUMBERING SYSTEM Module 5.2 1 Revision 01 Issue02

Upload: bai-haqi

Post on 14-Jul-2015

513 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

DIGITAL TECH (MECH)AKD 21102

CHAPTER 1

NUMBERING SYSTEM

Module 5.2 1Revision 01 Issue02

Page 2: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

INTRODUCTION• In electronics, the data has to be transform from

analogue to digital

• The conversion of data is in ON state (binary 1) and OFF state (binary 0)

• However, binary conversion has limitation when dealing with large value.

• Therefore, the conversion can be in the form of decimal, octal, hexadecimal

Module 5.2 2Revision 01 Issue02

Page 3: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

CHAPTER CONTENT

1. Identifies binary, octal and hexadecimal system

2. Convert and perform calculation on decimal and binary, octal and hexadecimal systems and vice versa.

3. Identify BCD system.

Module 5.2 3Revision 01 Issue02

Page 4: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• The conventional system

• Comprise of 10 digits from 0 to 9

• Base 10 system

• Positional value system numbering system

• Example : 15110,254110

DECIMAL SYSTEM

Module 5.2 4Revision 01 Issue02

Page 5: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• Example: 25410 consists of 2 HUNDREDS, 5 TENS and 4 ONE units.

• Written as : (2 X 100) + (5 X 10) + (4 X 1)

= (2 X 102) + (5 X 101) + (4 X 100)

• Digit 2 carries the MOST weight and is known as MOST SIGNIFICANT DIGIT (MSD)

• Digit 4 carries the LEAST weight and is known as LEAST SIGNIFICANT DIGIT (LSD)

DECIMAL SYSTEM

Module 5.2 5Revision 01 Issue02

Page 6: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• DISADVANTAGE for usage in digital computer example transistor due to :

-Having 10 Discrete Value Level which is extremely difficult to operate due to:

a. Any VARIATION of POWER SUPPLY would cause error

b. Component TOLERANCE MUST be ZERO

c. Component VALUE will change with AGE

6

DECIMAL SYSTEM

Page 7: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• Comprise of 2 digits (0 & 1) known as BITS

• Base 2 system. Example : 10112

• POSITIONAL value system

10112=(1X23)+(0X22)+(1X21)+(1X20)

• BINARY to DECIMAL Conversion10112=(1X23)+(0X22)+(1X21)+(1X20)

= 8+0+2+1

= 11sum of each bits multiplied by its particular positional value

7

BINARY SYSTEM

Page 8: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• DECIMAL to BINARY ConversionI) SUCCESSIVE POWER OF 2.

Example: 27 =16+8+2+1

=24+23+21+20

=(1x24)+(1x23)+(0X22)+(1X21)+(1X20) =110112

ii) SUCCESSIVE divide by 2 and record any remainder of division.

• Suitable for SMALL number

8

BINARY SYSTEM

Page 9: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• Any number converted into BINARY form, the binary numbers is known as a WORD.

• Each word is formed of a numbers of BITS(BINARY DIGITS) and this represents the WORD LENGTH

• Example : 34710 = 1010110112.

• So 1010110112 is a WORD. Word length is 9 because there is 9 bits

9

BINARY SYSTEM

Page 10: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• Convert from binary to decimal

• Convert from decimal to binary

10

BINARY SYSTEM

Page 11: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

1. Convert the following binary numbers to decimal:(a) 101012

(b) 1100112

(c) 10010012

(d) 101010112

2. Convert the following decimal numbers to binary:(a) 25

(b) 43

(c) 65

(d) 100.

Revision 01 Issue02 Module 5.2 11

TUTORIAL

Page 12: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• Base 8 systems

• Composed of 8 digits from 0 to 7

• OCTAL to DECIMAL conversionExample :

2758=(2x82)+(7x81)+(5x80)

=128+56+5 = 18910

• DECIMAL to OCTAL conversion Divide by 8 and Record any REMAINDER

of division

12

OCTAL SYSTEM

Page 13: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• OCTAL to BINARY conversion

- Convert each OCTAL number into 3 bits BINARY equivalent.

• Example :

a) 6358 TO BINARY. b)

6 3 5

110 011 101

Thus, 6358= 1100111012

13

OCTAL SYSTEM

Page 14: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• BINARY to OCTAL conversion

- Divide BINARY number into groups of 3 BITS starting from LSB.

Example :

1001110112 TO OCTAL.

100 111 011

4 7 3

Thus, 1001110112=4738

• If the FINAL group of MSB does NOT have 3 BITS, ADD enough ZERO to make up 3 BITS.

14

OCTAL SYSTEM

Page 15: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

1. Convert the following binary numbers to octal:(a) 101012

(b) 1100112

(c) 10010012

(d) 101010112

2. Convert the following decimal numbers to octal:(a) 25

(b) 43

(c) 65

(d) 100.

Revision 01 Issue02 Module 5.2 15

TUTORIAL

Page 16: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• BASE 16.

• Composed of 16 digit Symbols

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

• Example: 85D1B16

• HEX to DECIMAL

conversionExample :B2F16=(11x162)+(2x161)+(15x160)

=2816+32+15

=286310

16

HEXADECIMAL SYSTEM

Page 17: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• DECIMAL to HEX Conversion

Divide with 16 and take the REMAINDER of division

• HEX to BINARY Conversion-Convert each HEX digit into

4 bits BINARY equivalent.

i.e. B2F16 TO BINARY

B 2 F

1011 0010 1111

THUS, B2F16= 101100101111217

HEXADECIMAL SYSTEM

Page 18: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• BINARY to HEX Conversion

- Divide BINARY number into groups of 4 bits STARTING at LSB.

i.e. 1101101010012 TO HEX

1101 1010 1001

13 10 9

D A 9

Thus, 1101101010012=DA916

18

HEXADECIMAL SYSTEM

Page 19: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

Revision 01 Issue02 Module 5.2

• HEX to OCTAL Conversion and vice versa

i) Convert HEX to BINARY

ii)Convert BINARY to OCTAL

To Convert OCTAL to HEX, just REVERSE the process

Example : 3D16 convert to OCTAL

i)Convert HEX to BINARY, 3 D

0011 1101 3D16=1111012

ii)Convert BINARY to OCTAL, 111 101

7 5 1111012=758

Thus, 3D16=758

19

HEXADECIMAL SYSTEM

Page 20: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

1. Find the decimal equivalent of the octal number 41.

2. Find the octal equivalent of the decimal number 139.

3. Find the binary equivalent of the octal number 537.

4. Find the octal equivalent of the binary number 111001100.

5. Convert the hexadecimal number 3F to:

(a) decimal and (b) binary.

6. Convert the binary number 101111001 to

(a) octal and (b) hexadecimal.

7. Which of the following numbers is the largest?

(a) C516 (b) 110000012 (c) 3038.Revision 01 Issue02 Module 5.2 20

TUTORIAL

Page 21: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• Binary Coded Decimal

• Number represented in 4 bits binary code

• Leaving a space between each group of 4 digits

• Example :

a) 1110 to BCD is 0001 0001BCD

b) 1000 0101BCD in BCD to Decimal is 8510

Revision 01 Issue02 Module 5.2

BCD SYSTEM

21

Page 22: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

a) Convert from decimal to BCD

i. 94

ii. 529

iii. 2947

b) Convert from BCD to decimal

i. 0111 0000 1001BCD

ii. 0011 0110 0100BCD

Module 5.2

TUTORIAL

22Revision 01 Issue02

Page 23: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• The one’s complement of a binary number isformed by inverting the value of each digit of theoriginal binary number (i.e. replacing 1s with 0sand 0s with 1s)

• Example: the one’s complement of the binary number 1010 is 0101.

• Similarly, the one’s complement of 01110001 is 10001110.

– Note: if you add the one’s complement of a number to the original number the result will be all 1s,

Revision 01 Issue02 Module 5.2

ONE’S COMPLIMENT

23

Page 24: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• The one’s complement of a binary number is formed by inverting the value of each digit of the original binary number (i.e. replacing 1s with 0s and 0s with 1s)

• Example: the one’s complement of the binary number 1010 is 0101.

• Similarly, the one’s complement of 01110001 is 10001110. – Note: if you add the one’s complement of a number to the

original number the result will be all 1s,

Revision 01 Issue02 Module 5.2

ONE’S COMPLIMENT

24

Page 25: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

• Two’s complement notation is frequently used to represent negative numbers in computer mathematics (with only one possible code forzero—unlike one’s complement notation).

• The two’s complement of a binary number is formed by inverting the digits of the original binary number and then adding 1 to the result.

• Example: the two’s complement of the binary number 1001 is 0111. Similarly, the two’s complement of 01110001 is 10001111.

• When two’s complement notation is used to represent negative numbers the most significant digit (MSD) is always a 1

Revision 01 Issue02 Module 5.2

TWO’S COMPLIMENT

25

Page 26: Topic 1 Digital Technique Numbering system

Malaysian Institute of Aviation Technology

1. Find the one’s complement of the binary number 100010.

2. Find the two’s complement of the binary

number 101101.

Revision 01 Issue02 Module 5.2 26

TUTORIAL