Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part.

Similar presentations


Presentation on theme: "Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part."— Presentation transcript:

1 Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part of Chapter 4. Read the related chapters and do the exercises in the text book. Read the related chapters and do the exercises in the text book. I will give you a brief review on Thursday. I will give you a brief review on Thursday.

2 "Computers in the future may weigh no more "Computers in the future may weigh no more than 1.5 tons." than 1.5 tons." Popular Mechanics, forecasting the relentless Popular Mechanics, forecasting the relentless march of science, 1949 march of science, 1949

3 "I think there is a world market for may be five computers." Thomas Watson, chairman of IBM, 1943

4 "There is no reason anyone would want a computer in their home." Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977

5 Chapter 4: Objectives Understand purpose of binary numbers Understand purpose of binary numbers Be able to work with binary numbers. Be able to work with binary numbers. Know conditions of bistable environment and how they are met. Know conditions of bistable environment and how they are met. Determine truth value of Booleans. Determine truth value of Booleans. Identify transistor diagrams for AND, OR, and NOT gates. Identify transistor diagrams for AND, OR, and NOT gates. Construct & interpret circuit diagrams. Construct & interpret circuit diagrams.

6 Chapter 4, Sections 1 & 2 Introduction; Binary Numbering System Objectives: Understand the reason binary numbers are used. Understand the reason binary numbers are used. Translate binary and other bases to decimal. Translate binary and other bases to decimal. Do simple binary calculations. Do simple binary calculations. Know conditions of bistable environment and the way in which light switches, magnetic cores and transistors meet them. Know conditions of bistable environment and the way in which light switches, magnetic cores and transistors meet them.

7 4.1 Introduction Our computing agent: Electronic Digital Computer, from the bottom up. Ch. 4: At the bottom: digital logic components (transistors, gates, circuits) Ch. 4: At the bottom: digital logic components (transistors, gates, circuits) Ch. 5: Four basic subsystems (memory, ALU, CU, I/O) built from digital logic components, and organized into a complete computer system. Ch. 5: Four basic subsystems (memory, ALU, CU, I/O) built from digital logic components, and organized into a complete computer system.

8 4.2 Binary Numbering System What is it? What are the digits in decimal system? In the binary system? What is it? What are the digits in decimal system? In the binary system? Why we use binary in computers: More reliable Can be built from bi-stable devices Why we use binary in computers: More reliable Can be built from bi-stable devices

9 Bases commonly used in Computer Science Decimal (base 10) Digits: 0, 1, 2,..., 9 Place Value: 10 n... 10 3 10 2 10 1 10 0 Decimal (base 10) Digits: 0, 1, 2,..., 9 Place Value: 10 n... 10 3 10 2 10 1 10 0 Binary (base 2) Digits: 0, 1 Place Value: 2 n... 2 3 2 2 2 1 2 0 Binary (base 2) Digits: 0, 1 Place Value: 2 n... 2 3 2 2 2 1 2 0 Octal (base 8) Digits: 0, 1, 2,..., 7 Place Value: 8 n... 8 3 8 2 8 1 8 0 Octal (base 8) Digits: 0, 1, 2,..., 7 Place Value: 8 n... 8 3 8 2 8 1 8 0 Hexidecimal (base 16) Digits: 0, 1,..., 9, A, B, C, D, E, F Place Value: 16 n... 16 3 16 2 16 1 16 0 Hexidecimal (base 16) Digits: 0, 1,..., 9, A, B, C, D, E, F Place Value: 16 n... 16 3 16 2 16 1 16 0

10 Converting from other bases to Decimal Binary to decimal: 0101 1011 0*2 7 + 1*2 6 + 0*2 5 + 1* 2 4 + 1*2 3 + 0*2 2 + 1*2 1 + 1* 2 0 = 91 Binary to decimal: 0101 1011 0*2 7 + 1*2 6 + 0*2 5 + 1* 2 4 + 1*2 3 + 0*2 2 + 1*2 1 + 1* 2 0 = 91 Octal to decimal: 2537 2*8 3 + 5*8 2 + 3*8 1 + 7* 8 0 = 1375 Octal to decimal: 2537 2*8 3 + 5*8 2 + 3*8 1 + 7* 8 0 = 1375 Hexadecimal to decimal: A3F 10*16 2 + 3*16 1 + 15* 16 0 = 2623 Hexadecimal to decimal: A3F 10*16 2 + 3*16 1 + 15* 16 0 = 2623

11 Representing Data in Binary using 8 bits (one byte) unsigned numbers: (same as previous slide) unsigned numbers: (same as previous slide) signed numbers: Use leftmost bit for sign: 1 for - 0 for + Represent: -56 +56 signed numbers: Use leftmost bit for sign: 1 for - 0 for + Represent: -56 +56 characters: ASCII code for each. (See figure 4.3) characters: ASCII code for each. (See figure 4.3)

12 Bistable Devices Two stable energy states Two stable energy states Two states widely separated Two states widely separated Can sense which state without destroying it Can sense which state without destroying it Can switch from one state to another Can switch from one state to another

13 Examples Two balls at different potential energy state Two balls at different potential energy state.

14 Examples A capacitor in charged state and discharged state. A capacitor in charged state and discharged state. + + _ _ It is similar to the a charged battery and discharged battery.

15 Examples Different magnetized state. Different magnetized state. NSNS SNSN

16 Binary Storage Devices Devices which have been used for primary computer memory-- vacuum tubes vacuum tubes magnetic core magnetic core transistor transistor integrated circuit integrated circuit

17 4.1, 4.2 Homework Read Sections 4.1 and 4.2. Read Sections 4.1 and 4.2. Count to 32 in binary (Use 6 bits) Count to 32 in binary (Use 6 bits) Exercises, p. 179 # 1, 3, 5, 8 Exercises, p. 179 # 1, 3, 5, 8

18 4.3.1 Boolean Logic A branch of mathematics which deals with two logical values: True and False

19 Boolean Expressions A mathematical expression that has a value of True or False. e.g. For which integer values of A is each of the following true? A < 0 A < 0 A + 5 > 7 A + 5 > 7

20 Boolean Operations Operations on real numbers: + - * / Operations on Booleans: NOT AND OR

21 NOT Operation Similar to unary minus for numbers -- for an integer A. -A gives the opposite of A e.g. if A = -3, -A = ? for an integer A. -A gives the opposite of A e.g. if A = -3, -A = ? for a Boolean P, NOT P gives the opposite of P e.g. if P = False, NOT P = ? for a Boolean P, NOT P gives the opposite of P e.g. if P = False, NOT P = ?

22 Either a zero “0” or a “1” In Boolean Algebra, there are only two values can be taken by any variables: In Boolean Algebra, there are only two values can be taken by any variables: “0” or “1” “0” or “1”

23 AND Operation Binary operation like integer multiplication Partial multiplication table for A * B table for A * B Complete truth table for Boolean AND

24 OR Operation P OR Q is True when either one is true or both are true. Complete the truth table for Boolean OR

25 Evaluating Boolean Expressions Evaluate each to True or False for the given values. For A = -1, B = 5, and C = 0 (A 10) (A 10) (A * C = C) OR NOT(C = 0) (A * C = C) OR NOT(C = 0) NOT [ (A = C) ] NOT [ (A = C) ] (B = 5) OR ([A + C] = A) AND ([A + B] = 3) (Precedence rule: Do AND before OR) (B = 5) OR ([A + C] = A) AND ([A + B] = 3) (Precedence rule: Do AND before OR)

26 4.3.2 Electronic Gates for AND, OR, NOT Built from transistors, the gates produce the correct output for any given inputs. Symbols for the gates: Figure 4.15 How gates are built from transistors: Figures 4.16, 4.17, 4.18 Figures 4.16, 4.17, 4.18

27 Homework for 4.3 Read Section 4.3 Read Section 4.3 Exercises pp. 179-180 #17, and #18 Exercises pp. 179-180 #17, and #18

28 4.4 Circuits Circuit: a set of logic gates that take binary inputs and transform them into binary outputs. Some things computer circuits do: Math operations like addition Math operations like addition Comparisons (e.g. Are two inputs equal?) Comparisons (e.g. Are two inputs equal?)

29 Three Ways to Represent a Circuit Circuit diagram Circuit diagram Boolean expression Boolean expression Truth table Truth table

30 Circuit Diagram: Building Block AND, OR, and NOT gates AND, OR, and NOT gates + A B C C = A AND B C = A B. A B C C = A OR B C = A + B A C C = A NOT C = A

31 Construct a Circuit from a Boolean Expression Construct a circuit diagram from the following Boolean expression: (a or b) and (c or d) (a or b) and (c or d)

32 Construct a Boolean Expression from a Truth Table Example: to write the Example: to write the Boolean expression for the following truth table the following truth table a b c(output) a b c(output) 0 0 0 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 Sum of products method for each 1 output construct an and sub- expression using not for 0 inputs construct an or expression from the and sub-expressions

33 Circuit Design Design a circuit to compare two bits. The output should be 1 if the bits are equal and 0 otherwise. To design the circuit: Construct the truth table Construct the truth table Write the Boolean expression Write the Boolean expression Construct the circuit diagram (Check on simulator.) Construct the circuit diagram (Check on simulator.)

34 Circuit to do Addition A full adder circuit must be able to do additions such as the following: 1 0 1 1 1 0 1 1 + 0 1 1 1 + 0 1 1 1 What is the correct answer?

35 Diagram of a Full 4-bit Adder a4b4c4=0 c3 b3a3 s4 s3s2 s1 c1c2 b1b2a1a2 c0 one-bit adder

36 Construct a One-Bit Adder Once we construct a one-bit adder, we may connect as many together as we like, as shown on the previous slide. Construct the truth table Construct the truth table Write the Boolean expression Write the Boolean expression Construct the circuit diagram Construct the circuit diagram

37 Homework Read Section 4.4 Read Section 4.4 Do #19, p.180 and give: Do #19, p.180 and give: truth table truth table boolean expression boolean expression circuit circuit


Download ppt "Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part."

Similar presentations


Ads by Google