+ All Categories
Home > Documents > Digital Fundamentals - Helsinki

Digital Fundamentals - Helsinki

Date post: 24-Jan-2022
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
52
Digital Fundamentals Number systems, Operations, and codes
Transcript
Page 1: Digital Fundamentals - Helsinki

Digital Fundamentals

Number systems,

Operations, and codes

Page 2: Digital Fundamentals - Helsinki

Objectives

•Review the decimal number system

•Count in the binary number system

•Convert from decimal to binary and from binary to decimal

•Apply arithmetic operations to binary numbers

•Determine the 1's and 2's complements of a binary number

•Express signed binary numbers in sign-magnitude, 1's complement, 2's complement, and floating-point format

•Carry out arithmetic operations with signed binary numbers

•Convert between the binary and hexadecimal number systems

Number systems, operations, and codes

2

•Convert between the binary and hexadecimal number systems

•Add numbers in hexadecimal form

•Convert between the binary and octal number systems

•Express decimal numbers in binary coded decimal (BCD) form

•Add BCD numbers

•Convert between the binary system and the Gray code

•Interpret the American Standard Code for Information Interchange (ASCII)

•Use binary numbers and codes in a system application

Page 3: Digital Fundamentals - Helsinki

Binary numbers

Number systems, operations, and codes

3

Page 4: Digital Fundamentals - Helsinki

Application example

How can you detect a passing tennis ball?

Number systems, operations, and codes

4

Page 5: Digital Fundamentals - Helsinki

Binary weights

Number systems, operations, and codes

5

Page 6: Digital Fundamentals - Helsinki

Repeated division-by-2 method

Number systems, operations, and codes

6

Page 7: Digital Fundamentals - Helsinki

Number systems, operations, and codes

7

Page 8: Digital Fundamentals - Helsinki

Decimal fractions to binary

Number systems, operations, and codes

8

Page 9: Digital Fundamentals - Helsinki

Binary arithmetic – addition (ADD) & subtraction (SUB)

Number systems, operations, and codes

9

Page 10: Digital Fundamentals - Helsinki

Binary arithmetic – multiplication (MUL) & division (DIV)

Number systems, operations, and codes

10

Page 11: Digital Fundamentals - Helsinki

2’S complements of binary numbers

Number systems, operations, and codes

11

Page 12: Digital Fundamentals - Helsinki

Signed numbers

Number systems, operations, and codes

12

Page 13: Digital Fundamentals - Helsinki

Conversion from signed binary to decimal

Number systems, operations, and codes

13

Page 14: Digital Fundamentals - Helsinki

2’s complement to decimal

Number systems, operations, and codes

14

Page 15: Digital Fundamentals - Helsinki

Range of signed interger numbers that can be represented

N2

)12()2( 11 −+− −− NN tofrom

total combinations

2’s complement reduces the maximum absolute value to approximately half

Number systems, operations, and codes

15

with 8 bits the range is –128 to +128with 16 bits the range is –32768 to +32767

Page 16: Digital Fundamentals - Helsinki

Floating point numbers in binary format

single-precision

Number systems, operations, and codes

16

The exponent is expressed with a bias of 127, exponent has thus the

range of –126 to +128

Page 17: Digital Fundamentals - Helsinki

Number systems, operations, and codes

17

Page 18: Digital Fundamentals - Helsinki

Number systems, operations, and codes

18

Page 19: Digital Fundamentals - Helsinki

Arithmeticoperationswith signednumbers

Number systems, operations, and codes

19

Page 20: Digital Fundamentals - Helsinki

Number systems, operations, and codes

20

Page 21: Digital Fundamentals - Helsinki

Subtraction

Number systems, operations, and codes

21

Page 22: Digital Fundamentals - Helsinki

Multiplication

Number systems, operations, and codes

22

Page 23: Digital Fundamentals - Helsinki

Number systems, operations, and codes

23

Page 24: Digital Fundamentals - Helsinki

Division

Number systems, operations, and codes

24

Page 25: Digital Fundamentals - Helsinki

Number systems, operations, and codes

25

Page 26: Digital Fundamentals - Helsinki

Hexadecimal numbers

Number systems, operations, and codes

26

Page 27: Digital Fundamentals - Helsinki

binary to hexadecimal

Number systems, operations, and codes

27

Page 28: Digital Fundamentals - Helsinki

hexadecimal to binary

Number systems, operations, and codes

28

Page 29: Digital Fundamentals - Helsinki

hexadecimal to decimal

Number systems, operations, and codes

29

Page 30: Digital Fundamentals - Helsinki

hexadecimal to decimal

Number systems, operations, and codes

30

Page 31: Digital Fundamentals - Helsinki

decimal to hexadecimal

Number systems, operations, and codes

31

Page 32: Digital Fundamentals - Helsinki

hexadecimal addition

Number systems, operations, and codes

32

Page 33: Digital Fundamentals - Helsinki

hexadecimal subtraction

Method 1. Convert the hexadecimalnumber to binary. Take the 2’s comp-lement of the binary number. Convertthe result to hexadecimal.

Number systems, operations, and codes

33

Method 2. Subtract the hexadecimalnumber from the maximum hexadeci-mal number and add 1.

Page 34: Digital Fundamentals - Helsinki

Method 3. Write the sequence of single hexadecimal digits. Write the sequence inreverse below the forward sequence. The 1’s complement of each hex digit is thedigit directly below it. Add 1 to the resulting number to get the 2’s complement.

Number systems, operations, and codes

34

Page 35: Digital Fundamentals - Helsinki

Hexadecimal subtraction

Number systems, operations, and codes

35

Page 36: Digital Fundamentals - Helsinki

octal-to-decimal conversion

Number systems, operations, and codes

36

Page 37: Digital Fundamentals - Helsinki

decimal-to-octal conversion

Number systems, operations, and codes

37

Page 38: Digital Fundamentals - Helsinki

Number systems, operations, and codes

38

Page 39: Digital Fundamentals - Helsinki

binary-to-octal

Number systems, operations, and codes

39

Page 40: Digital Fundamentals - Helsinki

decimal-to-BCD

Number systems, operations, and codes

40

Page 41: Digital Fundamentals - Helsinki

BCD-to-decimal

Number systems, operations, and codes

41

Page 42: Digital Fundamentals - Helsinki

BCD addition

Number systems, operations, and codes

42

Page 43: Digital Fundamentals - Helsinki

Number systems, operations, and codes

43

Page 44: Digital Fundamentals - Helsinki

binary-to-gray

Number systems, operations, and codes

44

Page 45: Digital Fundamentals - Helsinki

gray-code application example

Number systems, operations, and codes

45

Page 46: Digital Fundamentals - Helsinki

ASCII

Number systems, operations, and codes

46

Page 47: Digital Fundamentals - Helsinki

ASCII control characters

Number systems, operations, and codes

47

Page 48: Digital Fundamentals - Helsinki

Extended ASCII characters

Number systems, operations, and codes

48

Page 49: Digital Fundamentals - Helsinki

Parity method for error detection

Number systems, operations, and codes

49

Page 50: Digital Fundamentals - Helsinki

Digital system application

Number systems, operations, and codes

50

Page 51: Digital Fundamentals - Helsinki

Number systems, operations, and codes

51

Page 52: Digital Fundamentals - Helsinki

Number systems, operations, and codes

52


Recommended