Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic and Computer Design Fundamentals

Similar presentations


Presentation on theme: "Logic and Computer Design Fundamentals"— Presentation transcript:

1 Logic and Computer Design Fundamentals
Chapter 1 – Digital Systems and Information Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode)

2 Overview Digital Systems, Computers, and Beyond
Information Representation Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary coded decimal)] Alphanumeric Codes Parity Bit Gray Codes Chapter 1

3 DIGITAL & COMPUTER SYSTEMS - Digital System
Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs. Discrete Information Processing System Discrete Inputs Discrete Outputs System State Chapter 1

4 example: ticket counter
In a simple scenario, any digital system can be considered either as being combinational or sequential Combinational Circuit always gives the same output for a given set of inputs ex: adder always generates sum and carry, regardless of previous inputs Sequential Circuit stores information output depends on stored information (state) plus input so a given input might produce different outputs, depending on the stored information example: ticket counter advances when you push the button output depends on previous state useful for building “memory” elements and “state machines” 3-4

5 Combinational vs. Sequential
Two types of locks. One combinational and the other sequential 30 25 20 5 10 4 1 8 15 Sequential Success depends on the sequence of values (e.g, 2R(13) , 1L(22) , 1R ( 3). Combinational Success depends only on the values, not the order in which they are set. 3-5

6 Digital Computer Example
Memory Control unit CPU Datapath Inputs: Outputs: LCD keyboard, mouse, microphone screen, speakers Input/Output Synchronous or Asynchronous? Chapter 1

7 And Beyond – Embedded Systems
Computers as integral parts of other products Examples of embedded computers Microcomputers Microcontrollers Digital signal processors Chapter 1

8 Embedded Systems Examples of Embedded Systems Applications Cell phones
Automobiles Video games Copiers Dishwashers Flat Panel TVs Global Positioning Systems ( GPS) Chapter 1

9 Digital systems operate with signals which have only two values, known as logical 0 (zero) and logical 1 (one). Other equivalent ways of understanding and/or representing the two (i.e. binary) values of a digital system include: FALSE OFF DOWN LOW OPEN TRUE ON UP HIGH CLOSED Digital logic circuits operate with binary values of current or voltage, that is, with two values representing the logical 0 and logical 1 of a digital system. 2-9

10 Computer is a binary digital system.
Now we must define the different rages of logic 0 and logic 1 for different Semiconductor technologies. For example for MOS we may consider the following arrangement Chapter 1

11 floating state or tri-state )
As can be seen 0V ≤ Logic 0 ≤0.5 V 2.4 V ≤ logic 1 ≤ 2.9V Explanation: Illegal state ( high impedance, floating state or tri-state ) Chapter 1

12 What are other physical quantities
Binary Values: Other Physical Quantities Voltage Magnetic Field Direction Surface Pits/Light What are other physical quantities represent 0 and 1? • CPU • Disk • CD • Dynamic RAM Electrical Charge Chapter 1

13 Lesson 1: number systems

14 For example the decimal number of 543.21 is represented as:
Number Systems The decimal number system is employed in everyday arithmetic to represent number by strings of digits. For example depending on its position in the string, each digit has an associated value of an integer raised to the power of 10. For example the decimal number of is represented as:  (5x122) +(4x101) +(3x100 ) +(2x10-1) +(1x10 -2) Chapter 1

15 The base is b=10 since we deal with the decimal number.
Number Systems ( Cont.) The base is b=10 since we deal with the decimal number. The digits 5,4,3,2,1, satisfy the following condition:  0 ≤ 5,4,3,2,1 < 10 With the smallest possible digit being 0 while the largest possible digit being 9. Problem 1.1. What is the presentation of the following number 724.5? Chapter 1

16 j      An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m  1 A- m Ai r 
NUMBER SYSTEMS – Representation In general our notation for an arbitrary base (radix) r for a string of digits such : An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m  1 A- m in which 0  Ai < r and . is the radix point can be presented as: j    i = n - 1 j = - 1 (Number) = Ai r i Aj r r i = 0 j = - m (Integer Portion) + (Fraction Portion) Chapter 1

17 Now we are interested in 4 bases: Base 10 for which r =10
Number Systems ( Cont.) Now we are interested in 4 bases: Base 10 for which r =10 Base 2 for which r =2 Base 8 for which r = 8 Base 16 for which r = 16. Then by replacing the value of r ( some books use b instead of r) in the general equation we can obtain the equivalent of that number in the required base. Chapter 1

18 For each base we adopt the following conventions:
Number Systems ( Cont.) For each base we adopt the following conventions:  Base 10 digits : 0,1,2,3,……9. Base 2, digits 0,1  Base 8 digits 0,1,2,3,4… 7  Base 16 digits 0,1,2,3,4,…8,9,A,B,C,D,E,F. Chapter 1

19 Are used for the above 16 bases.
Number Systems ( Cont.) What is new is that : A represents 10 B represents 11 C represents 12 D represents 13 E represents 14 F represents 15 Are used for the above 16 bases. Chapter 1

20 We give “ Special names” to our bases: Base 10 is the decimal system
Number Systems ( Cont.) We give “ Special names” to our bases: Base 10 is the decimal system Base 2 is the binary system Base 8 is the octal system Base 16 is the hexadecimal system. From now on we must specify the number system of interest in order to specify a number. Chapter 1

21 Lesson 2: number system conversion

22 Converting Decimal to Any base
Repeatedly divide the number by base r and save the remainders. The digits for the new radix are the remainders in reverse order of their computation. Example: Convert to N2 Example: Convert to N16 Example: Convert to N8 625 – 512 = 113 => 9 113 – 64 = 49 => 6 49 – 32 = 17 => 5 17 – 16 = => 4 1 – = => 0 Placing 1’s in the result for the positions recorded and 0’s elsewhere,

23 Converting Any base to Decimal
To convert to decimal, use decimal arithmetic to form S (digit × respective power of base r). Example: Convert to N10:   Example: Convert 7258 to N10:   Example: Convert to N10:   Example: Convert A2E16 to N10: Powers of 2: 43210 => 1 X = 16 + 1 X = 8 + 0 X = 0 + 1 X 21 = 2 + 0 X 20 = 0 2610

24 Convert from base X to base Y
First convert from base X to decimal Then convert from decimal to base Y Example: convert to hexadecimal Example: convert to binary Example: convert to octal Chapter 1

25 The binary system The digit 0, 1 in the binary system have a special
name. They are called bits. Bits represent the smallest memory element used in every computer. Problem 1.3 How many bits are needed to represent A decimal digit? A binary digit ? An octal digit? A hexadecimal digit? Chapter 1

26 Number Systems ( Cont.) In computer literature we define memories as:
 2 10 = 1024 = 1 K ( Kilo) bytes  2 20 = 2 10 x 2 10 = 1 K x 1 K = 1M ( Mega)  2 30 = x 2 10 x = 1 K x 1 K x 1K = 1G ( giga) Chapter 1

27 A) binary to octal, hexadecimal and B) octal, hexadecimal to binary.
Number Systems ( Cont.) Working with binary, octal and hexadecimal numbers is very easy. We can easily convert A) binary to octal, hexadecimal and B) octal, hexadecimal to binary. Chapter 1

28 Convert the following binary number into its octal equivalent.
Number Systems ( Cont.) A For converting I. Binary to octal Group “ every three bits ( beginning from the right , ( LSB) and convert each group of 3 bits into octal. Problem 1.4 Convert the following binary number into its octal equivalent. (101111)2 = ( ?) 8 Chapter 1

29 Number Systems ( Cont.) II. Binary to hexadecimal
Group “ every four bits” ( beginning from the right ( LSB) and convert each group of 4 bits into hexadecimal. Problem 1.5  ( ) 2 = ( ?) 16 Chapter 1

30 Octal to binary “ ungroup every digital and convert it into 3 bits
(b) for converting Octal to binary “ ungroup every digital and convert it into 3 bits Problem 1.6 ( 75) 8 = ( ?) 2 Hexadecimal to binary “ Ungroup” every digit and convert it into 4 bits. Problem 1.7  ( FE) 16 = ( ?) 2 Chapter 1

31 Numbers in Different Bases Good idea to memorize!
Decimal (Base 10) Binary (Base 2) Octal (Base 8) Hexadecimal (Base 16) 00 00000 01 00001 02 00010 03 00011 04 00100 05 00101 06 00110 07 00111 08 01000 10 09 01001 11 01010 12 0A 01011 13 0B 01100 14 0C 01101 15 0D 01110 16 0E 01111 17 0F 10000 20 Chapter 1

32 Algorithm for converting from decimal into binary form
Break every decimal into two: integer part . Fractional part For the integer part we follow the procedure that we outlined before: See the next page for details: Chapter 1

33 Number Systems ( Cont.) Quotient Remainder Digit Int ( N/2) = q0
N-2q0 = r 0 r0 Int ( q0/ 2) = q1 q0-2q1 = r 1 r 1 Int ( q1/2) = q2 q1-2q2 = r2 r2 Int ( q2/2) = q3 q2-2q3 = r3 r3 . Until q n+1 becomes zero Chapter 1

34 The resulting binary from is
Number Systems ( Cont.) The resulting binary from is  rn rn-1 …..r3 r2 r1 r0 for the integer part. Perhaps an easier way to remember the algorithm would be the following way ( see the explanation in the class ). This can be generalized for converting the fractional part. Chapter 1

35 Number Systems ( Cont.) Problem 1.10  ( 0.625) 10 = ( ?) 2
 ( 0.625) 10 = ( ?) 2 Problem 1.11  ( 28.21) 10 = ( ?) 2 Chapter 1

36 What does (543.21)10 represent in a) hexadecimal? b) octal?
Number Systems ( Cont.) Problem 1.2 : What does (543.21)10 represent in a) hexadecimal? b) octal? Problem 1.10  ( 0.625) 10 = ( ?) 8 Problem 1.11  ( 28.21) 10 = ( ?) 16 Chapter 1

37 Lesson 3: number system arithmetic

38 Single Bit Binary Addition with Carry

39 Multiple Bit Binary Addition
Extending this to two multiple bit examples: Augend Addend Sum= ? Carries Augend Addend Sum

40 Number Systems ( Cont.) Problem 1.16  ( 01100) + ( 10001) =?????
 ( 01100) + ( 10001) =????? Chapter 1

41 Single Bit Binary Subtraction with Borrow
Given two binary digits (X,Y), a borrow in (Z) we get the following difference (S) and borrow (B): Borrow in (Z) of 0: Borrow in (Z) of 1: Z X 1 - Y -0 -1 BS 0 0 1 1 0 1 Z 1 X - Y -0 -1 BS 11 1 0 0 0 1 1

42 Multiple Bit Binary Subtraction
Extending this to two multiple bit examples: Minuend Subtrahend Difference= ? Borrows Minuend Subtrahend – –10011 Difference

43 Binary Multiplication

44 Arithmetic Operations
Problem 1.15 ( 1011) x ( 101) see the solution in the class Chapter 1

45 Arithemtic operations in other systems
Basically it is the same as decimal, except you need to use the tables of that system. Problem 1.12 ( 59F) 16 + ( E46) 16 = ???? Problem 1.13 ( 3FE) 16 + ( E2)16 = ???? Octal Multiplication Problem 1.14 Perform the multiplication ( 762 ) 8 x ( 45) 8 Chapter 1

46 Terms of Use All (or portions) of this material © 2008 by Pearson
Education,Inc. Permission is given to incorporate this material or adaptations thereof into classroom presentations and handouts to instructors in courses adopting the latest edition of Logic and Computer Design Fundamentals as the course textbook. These materials or adaptations thereof are not to be sold or otherwise offered for consideration. This Terms of Use slide or page is to be included within the original materials or any adaptations thereof. Chapter 1


Download ppt "Logic and Computer Design Fundamentals"

Similar presentations


Ads by Google