Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC

Similar presentations


Presentation on theme: "CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC"— Presentation transcript:

1 CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
EKT 121 / 3 ELEKTRONIK DIGIT 1 CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC

2 Number & codes (1) Digital vs. Analog Numbering systems Octal (Base 8)
Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16) Octal (Base 8) Number conversion Binary arithmetic 1’s and 2’s complements of binary numbers

3 Number & codes (2) Signed/Unsigned numbers
Arithmetic operations with signed numbers Coded Binary-Coded-Decimal (BCD)/ 8421 ASCII Gray Excess-3) Error Detecting and Correction Codes Floating Point Numbers

4 Digital vs. Analog 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 (0/1).

5 Digital vs. Analog (cont.)
Digital system: combination of devices designed to manipulate logical information or physical quantities that are represented in digital forms Analog system: contains devices manipulate physical quantities that are represented in analog forms

6 Digital vs. Analog (cont.)
1 Systems which process discrete (step by step) values Systems which are capable of processing a continuous range of values varying with respect to time 2 Digital representation the quantities - digits (0/1) Analog representation a quantity – I / V / meter movement 3 4 Example: Digital watch, PSP, iPod, Handphone, digital computers and calculators Example: audio amplifiers, magnetic tape recording and playback equipment

7 Digital vs. Analog (cont.)
Why digital ? Problem with all signals – noise Noise isn't just something that you can hear - the fuzz that appears on old video recordings also qualifies as noise. In general, noise is any unwanted change to a signal that tends to corrupt it. Digital and analogue signals with added noise: Digital : easily be recognized even among all that noise : either 0 or 1 Analog : never get back a perfect copy of the original signal

8 Digital Techniques Advantages: Limitations: Easier to design
Information storage is easy Accuracy and precision are greater Operation can be programmed - simple Digital circuits less affected by noise More digital circuitry can be fabricated on IC chips Limitations: In real world there are analog in nature and these quantities are often I/O that are being monitored, operated on, and controlled by a system. Thus, conversion and re-conversion in needed

9 Analog Waveform

10 Digital Waveform

11 Introduction to Numbering Systems
We are familiar with decimal number systems for daily used such as calculator, calendar, phone or any common devices use this numbering system : Decimal = Base 10 Some other number systems: Binary = Base 2 Octal = Base 8 Hexadecimal = Base 16

12 Numbering Systems Decimal Binary Octal Hexadecimal 0 ~ 9 0 ~ 1 0 ~ 7
0 ~ 9, A ~ F

13 Numbering Systems (cont.)
A B C D E F Binary Octal Hex Dec N U M B E R S Y T

14 Significant Digits Binary : Most Significant Bit Least Significant Bit (MSB) (LSB) Hexadecimal: 1 D 6 3 A 7 Most Significant Digit Least significant Digit (MSD) (LSD)

15 Decimal numbering system (base 10)
Base 10 system: (0,1,2,3,4,5,6,7,8,9) Example : 39710 Weights for whole numbers are positive power of ten that increase from right to left , beginning with 100 3 X 102 + 9 X 101 + 7 X 100 => => 39710

16 Binary Number System (base 2)
Base 2 system: (0 , 1) used to model the series of computer electrical signals represent the informations. 0 represents the no voltage or an ‘off’ state 1 represents the presence of voltage or an ‘on’ state Example: Weights in a binary number are based on power of two, that increase from right to right to left, beginning with 20 1X 22 + 0 X 21 + 1 X 20 => => 510

17 Octal Number System (base 8)
Base 8 system: (0,1,………,7) multiplication and division algorithms for conversion to and from base 10 example : convert to decimal Weights in a binary number are based on power of eight that increase from right to right to left, beginning with 80 + 7X 82 5 X 81 + 6 X 80 => 49410 => Readily converts to binary Groups of three (binary) digits can be used to represent each octal number example : convert to binary

18 Hexadecimal Number System (base 16)
BINARY 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 A 10 1010 B 11 1011 C 12 1100 D 13 1101 E 14 1110 F 15 1111 Base 16 system Uses digits 0 ~ 9 & letters A,B,C,D,E,F Groups of four bits represent each base 16 digit

19 Hexadecimal Number System (2)
Base 16 system multiplication and division algorithms for conversion to and from base 10 example : A9F16 convert to decimal A F Weights in a hexadecimal number are based on power of sixteen that increase from right to right to left,beginning with 160 10X 162 + 9 X 161 + 15 X 160 => 271910 => Readily converts to binary Groups of four (binary) digits can be used to represent each hexadecimal number example : A9F16 convert to binary A F

20 Number Conversion Any Radix (base) to Decimal Conversion

21 Number Conversion (BASE 2 –> 10)
Binary to Decimal Conversion

22 Binary to Decimal Conversion
Convert ( )2 to its decimal equivalent: Binary Positional Values x x x x x x x x 27 26 25 24 23 22 21 20 Products = 17310

23 Octal to Decimal Conversion
Convert 6538 to its decimal equivalent: Octal Digits x x x Positional Values Products = 42710

24 Hexadecimal to Decimal Conversion
Convert 3B4F16 to its decimal equivalent: Hex Digits B F x x x x Positional Values Products = 15,18310

25 Number Conversion INTEGER DIGIT:
Decimal to Any Radix (Base) Conversion INTEGER DIGIT: Repeated division by the radix & record the remainder FRACTIONAL DECIMAL: Multiply the number by the radix until the answer is in integer example : to Binary

26 Decimal to Binary Conversion
Remainder 2 5 = 2 1 2 = 6 = 3 = MSB LSB 1 = =

27 Decimal to Binary Conversion
MSB LSB Carry x 2 = x 2 = x 2 = 0.5 x 2 = Answer:

28 Decimal to Octal Conversion
Convert to its octal equivalent: 427 / 8 = 53 R3 Divided by 8; R is LSD 53 / 8 = 6 R Divide Q by 8; R is next digit 6 / 8 = 0 R6 Repeat until Q = 0 6538

29 Decimal to Hexadecimal Conversion
Convert to its hexadecimal equivalent: 830 / 16 = 51 R / 16 = 3 R3 3 / 16 = 0 R3 = E in Hex 33E16

30 Decimal to Octal Conversion
Binary to Octal Conversion (vice versa) Grouping the binary position in groups of three starting at the least significant position.

31 Octal to Binary Conversion
Each octal number converts to 3 binary digits To convert 6538 to binary, just substitute code:

32 Example : Number Conversion
Convert the following binary numbers to their octal equivalent (vice versa). 47.38 Answer: 11.748

33 Binary to Hexadecimal Conversion
Binary to Hexadecimal Conversion (vice versa) Grouping the binary position in 4-bit groups, starting from the least significant position.

34 Binary to Hexadecimal Conversion
The easiest method for converting binary to hexadecimal is using a substitution code Each hex number converts to 4 binary digits

35 Number Conversion Example: Convert the following binary numbers to their hexadecimal equivalent (vice versa). 1F.C16 Answer: 10.816

36 Substitution Code (1) = 56AE6A16 5 6 A E 6 A
Convert ( )2 to hex using the 4-bit substitution code : A E A = 56AE6A16

37 Substitution Code (2) Substitution code can also be used to convert binary to octal by using 3-bit groupings: =

38 Binary Addition 0 + 0 = 0 Sum of 0 with a carry of 0
Example: ???

39 Simple Arithmetic Addition Example: 100011002 5816 + 1011102 + 2416
Substraction 101102 Example: 5816 7C16

40 Binary Subtraction 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1
10 -1 = with a borrow of 1 Example: ???

41 Binary Multiplication
0 X 0 = 0 0 X 1 = 0 Example: 1 X 0 = 1 X 1 = X 100110 000000

42 Binary Division Use the same procedure as decimal division

43 1’s complements of binary numbers
Changing all the 1s to 0s and all the 0s to 1s Example: Binary number ’s complement ****** same as applying NOT gate ******

44 2’s complements of binary numbers
Step 1: Find 1’s complement of the number Binary # 1’s complement Step 2: Add 1 to the 1’s complement

45 Signed Magnitude Numbers
Sign bit 31 bits for magnitude 0 = positive 1 = negative ***** This is your basic Integer format

46 Sign numbers Left most is the sign bit Sign-magnitude 1’s complement
0 is for positive, and 1 is for negative Sign-magnitude = +25 sign bit magnitude bits 1’s complement The negative number is the 1’s complement of the corresponding positive number Example: +25 is is

47 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

48 Digital Codes (1) BCD (Binary Coded Decimal) / 8421 Code
Represent each of the 10 decimal digits (0~9) as a 4-bit binary code. Example: Convert 15 to BCD. Convert 10 to binary and BCD.

49 Digital Codes (2) ASCII (American Standard Code for Information Interchange) Code Used to translate from the keyboard characters to computer language A world standard alphanumeric code for microcomputers and computers A 7-bit code representing 27 (128) diff. characters (26 upper case, 26 lower case, 10 numbers, 33 special characters/symbol, 33 ctrl characters 8-bit version ASCII (USACC-II 8 or ASCII-8) represent max. of 256 characters.

50 Digital Codes (3) The Gray Code Only 1 bit changes
Decimal Binary Gray Code 0000 1 0001 2 0010 0011 3 4 0100 0110 5 0101 0111 6 The Gray Code Only 1 bit changes Can’t be used in arithmetic circuits Can convert from Binary to Gray Code and vice versa. How to convert ?????

51 Digital Codes (4) Excess-3 Code Used to express decimal numbers.
The code derives its name from the fact that each binary code is the corresponding 8421 code plus 3

52 Digital Codes (6) **** Assingment#1: due date 10/01/11 ****
Error Detecting and Correction Code Required for reliable transmission and storage of digital data. Error Detecting Codes Parity (Even and Odd) Check sums Error Correcting Codes Hamming Code ???? **** Assingment#1: due date 10/01/11 ****

53 Digital Codes (7) EBCDIC (Extended Binary Coded Decimal Interchange) Code Mainly used with large computer systems like mainframe. An 8-bit code and accommodates up to 256 characters Divided into 2 portions: 4 zone bits (on the left) and numeric bits (on the right)

54 Floating Point Numbers (FPN)
A real number or FPN is a number which has both an integer and a fractional part. Examples: Real decimal numbers: , , Real binary numbers: , , Generally, FPNs are expressed in exponential notation. Eg: can be written as 3 x 104 can be written as x 102 can be written as x 103 mantissa exponent

55 End of Numbers system


Download ppt "CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC"

Similar presentations


Ads by Google