Download presentation
Presentation is loading. Please wait.
Published byBrenda Bell Modified over 9 years ago
1
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION
2
1.0Number & Codes Digital and analog quantities Decimal numbering system (Base 10) Binary numbering system (Base 2) Hexadecimal numbering system (Base 16) Octal numbering system (Base 8) Number conversion Binary arithmetic 1’s and 2’s complements of binary numbers
3
Signed numbers Arithmetic operations with signed numbers Binary-Coded-Decimal (BCD) ASCII codes Gray codes Digital codes & parity
4
Digital and analog quantities Two ways of representing the numerical values of quantities : i) Analog (continuous) ii) Digital (discrete) Analog : a quantity represented by voltage, current or meter movement that is proportional to the value that quantity Digital : the quantities are represented not by proportional quantities but by symbols called digits
5
Digital and analog systems Digital system: combination of devices designed to manipulate logical information or physical quantities that are represented in digital forms include digital computers and calculators, digital audio/video equipments, telephone system. Analog system: contains devices manipulate physical quantities that are represented in analog form audio amplifiers, magnetic tape recording and playback equipment, and simple light dimmer switch
6
Analog Quantities Continuous values
7
Digital Waveform
8
Introduction to Numbering Systems We are all familiar with the decimal number system (Base 10). Some other number systems that we will work with are: Binary Base 2 Octal Base 8 Hexadecimal Base 16
9
Number Systems 0 ~ 9 0 ~ 1 0 ~ 7 0 ~ F Decimal Binary Octal Hexadecimal
10
Characteristics of Numbering Systems 1) The digits are consecutive. 2) The number of digits is equal to the size of the base. 3) Zero is always the first digit. 4) When 1 is added to the largest digit, a sum of zero and a carry of one results. 5) Numeric values determined by the implicit positional values of the digits.
11
00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00001000 00001001 00001010 00001011 00001100 00001101 00001110 00001111 000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017 0123456789ABCDEF0123456789ABCDEF 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 BinaryOctalHexDec NUMBER SYSTEMSNUMBER SYSTEMS
12
Significant Digits Binary: 11101101 Most significant digit Least significant digit Hexadecimal: 1D63A7A Most significant digit Least significant digit
13
Binary Number System Also called the “Base 2 system” The binary number system is used to model the series of electrical signals computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on state
14
Binary Numbering Scale Base 2 NumberBase 10 EquivalentPowerPositional Value 00002020 1 00112121 2 01022 4 01132323 8 10042424 16 10152525 32 11062626 64 11172727 128
15
Octal Number System Also known as the Base 8 System Uses digits 0 - 7 Readily converts to binary Groups of three (binary) digits can be used to represent each octal digit Also uses multiplication and division algorithms for conversion to and from base 10
16
Hexadecimal Number System Base 16 system Uses digits 0-9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit
17
Number Conversion Any Radix (base) to Decimal Conversion
18
Number Conversion Binary to Decimal Conversion
19
Convert (10101101) 2 to its decimal equivalent: Binary 1 0 1 0 1 1 0 1 Positional Values x x x xx x x x 2020 21212 2323 2424 2525 2626 2727 Products
20
Octal to Decimal Conversion Convert 653 8 to its decimal equivalent: 6 5 3 xx x 8 2 8 1 8 0 Positional Values Products Octal Digits
21
Hexadecimal to Decimal Conversion Convert 3B4F16 to its decimal equivalent: Hex Digits 3 B 4 F xx x 16 3 16 2 16 1 16 0 Positional Values Products x
22
Number Conversion Decimal to Any Radix (Base) Conversion 1. INTEGER DIGIT: Repeated division by the radix & record the remainder 2. FRACTIONAL DECIMAL: Multiply the number by the radix until the answer is in integer Example: 25.3125 to Binary
23
Decimal to Binary Conversion 2 5 = 12 + 1 2 1 2 = 6 + 0 2 6 = 3 + 0 2 3 = 1 + 1 2 1 = 0 + 1 2 MSBLSB 25 10 = 1 1 0 0 1 2 Remainder
24
Decimal to Binary Conversion Carry. 0 1 0 1 0.3125 x 2 = 0.625 0 0.625 x 2 = 1.25 1 0.25 x 2 = 0.50 0 0.5 x 2 = 1.00 1 The Answer: 1 1 0 0 1.0 1 0 1 MSBLSB
25
Decimal to Octal Conversion Convert 427 10 to its octal equivalent: 427 / 8 = 53 R3Divide by 8; R is LSD 53 / 8 = 6 R5Divide Q by 8; R is next digit 6 / 8 = 0 R6Repeat until Q = 0 653 8
26
Decimal to Hexadecimal Conversion Convert 830 10 to its hexadecimal equivalent:
27
Number Conversion Binary to Octal Conversion (vice versa) 1. Grouping the binary position in groups of three starting at the least significant position.
28
Octal to Binary Conversion Each octal number converts to 3 binary digits To convert 653 8 to binary, just substitute code: 6 5 3 110 101 011
29
Number Conversion Example: Convert the following binary numbers to their octal equivalent (vice versa). a) 1001.1111 2 b) 47.3 8 c) 1010011.11011 2 Answer: a) b) c)
30
Number Conversion Binary to Hexadecimal Conversion (vice versa) 1. Grouping the binary position in 4-bit groups, starting from the least significant position.
31
Binary to Hexadecimal Conversion The easiest method for converting binary to hexadecimal is to use a substitution code Each hex number converts to 4 binary digits
32
Number Conversion Example: Convert the following binary numbers to their hexadecimal equivalent (vice versa). a) 10000.1 2 b) 1F.C 16 Answer: a) b)
33
Convert 010101101010111001101010 2 to hex using the 4-bit substitution code : 0101 0110 1010 1110 0110 1010 Substitution Code
34
Substitution code can also be used to convert binary to octal by using 3-bit groupings: 010 101 101 010 111 001 101 010 Substitution Code
35
Binary Addition 0 + 0 = 0Sum of 0 with a carry of 0 0 + 1 = 1Sum of 1 with a carry of 0 1 + 0 = 1 Sum of 1 with a carry of 0 1 + 1 = 10Sum of 1 with a carry of 1 Example: 11001 111 + 1101+ 11 100110 ???
36
Simple Arithmetic Addition Example: 10001100 2 + 101110 2 10111010 2 Substraction Example: 1000100 2 - 101110 2 10110 2 Example: 58 16 + 24 16 7C 16
37
Binary Subtraction 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 10 -1 = 10 -1 with a borrow of 1 Example: 1011 101 - 111- 11 100 ???
38
Binary Multiplication 0 X 0 = 0 0 X 1 = 0Example: 1 X 0 = 0100110 1 X 1 = 1 X 101 100110 000000 + 100110 10111110
39
Binary Division Use the same procedure as decimal division
40
1’s complements of binary numbers Changing all the 1s to 0s and all the 0s to 1s Example: 1 1 0 1 0 0 1 0 1Binary number 0 0 1 0 1 1 0 1 01’s complement
41
2’s complements of binary numbers 2’s complement Step 1: Find 1’s complement of the number Binary #11000110 1’s complement00111001 Step 2: Add 1 to the 1’s complement 00111001 + 00000001 00111010
42
Signed Magnitude Numbers Sign bit 0 = positive 1 = negative 31 bits for magnitude This is your basic Integer format 110010..…00101110010101
43
Sign numbers Left most is the sign bit 0 is for positive, and 1 is for negative Sign-magnitude 0 0 0 1 1 0 0 1 = +25 sign bit magnitude bits 1’s complement The negative number is the 1’s complement of the corresponding positive number Example: +25 is 00011001 -25 is 11100110
44
Sign numbers 2’s complement The positive number – same as sign magnitude and 1’s complement The negative number is the 2’s complement of the corresponding positive number. Example Express +19 and -19 in i. sign magnitude ii. 1’s complement iii. 2’s complement
45
Digital Codes BCD (Binary Coded Decimal) Code 1. Represent each of the 10 decimal digits (0~9) as a 4-bit binary code. Example: Convert 15 to BCD. 1 5 0001 0101 BCD Convert 10 to binary and BCD.
46
Digital Codes ASCII (American Standard Code for Information Interchange) Code 1. Used to translate from the keyboard characters to computer language
47
Digital Codes The Gray Code Only 1 bit changes Can’t be used in arithmetic circuits Binary to Gray Code and vice versa. DecimalBinaryGray Code 00000 10001 200100011 3 0010 401000110 501010111 601100101
48
END OF Number & Codes
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.