Presentation is loading. Please wait.

Presentation is loading. Please wait.

CISC101 Reminders Your group name in onQ is your grader’s name.

Similar presentations


Presentation on theme: "CISC101 Reminders Your group name in onQ is your grader’s name."— Presentation transcript:

1 CISC101 Reminders Your group name in onQ is your grader’s name.
Winter 2018 CISC101 11/24/2018 CISC101 Reminders Your group name in onQ is your grader’s name. Labs start this week. Meet your TA! Get help with: Exercise 1. Python installation issues. Lecture material. Assignment expectations…. Winter 2018 CISC101 - Prof. McLeod Prof. Alan McLeod

2 Today Digital Systems Logic (or How does an integrated circuit work?), Cont. Yesterday we discussed how you would build AND, OR and NOT gates using transistors. Numeric representation (or How does binary and hexadecimal work?). If we have time… Winter 2018 CISC101 - Prof. McLeod

3 “AND” Gate Two transistors forming an “AND” gate:
Both Input-1 and Input-2 have to be “1” (ie. 5 volts) for the Output to be “on”. How an “AND” gate is drawn in a logic diagram: Logic or “Truth” table: Winter 2018 CISC101 - Prof. McLeod

4 “OR” Gate Either Input-1 or Input-2 can cause Output to be “On”.
An “OR” gate in a logic diagram. Winter 2018 CISC101 - Prof. McLeod

5 “NOT” Gate The “NOT” gate just reverses the Input: Winter 2018
CISC101 - Prof. McLeod

6 “NOR” Gate Same as NOT(OR), like an OR gate followed by a NOT gate.
Winter 2018 CISC101 - Prof. McLeod

7 “NAND” Gate Same as NOT(AND), like an AND gate followed by a NOT gate.
Winter 2018 CISC101 - Prof. McLeod

8 “XOR” Gate One way: XOR gate X Z=XY Y
(These are NOT(AND) or “NAND” gates.) Winter 2018 CISC101 - Prof. McLeod

9 Summary: “Truth” or Logic Tables
AND OR I1 I2 Output I1 I2 Output NOT I Output 1 1 1 1 1 1 1 1 1 1 1 1 1 1 NAND NOR XOR I1 I2 Output I1 I2 Output I1 I2 Output 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 CISC101 - Prof. McLeod

10 Summary, Cont. Gates: You can use transistors to build a circuit, or “gate”, that provides the logic for each of these operators. Notation: ab (you will also see just “ab”) means “a AND b” a+b means “ a OR b” a means NOT(a) ab means “a XOR b” Winter 2018 CISC101 - Prof. McLeod

11 Digital Circuits Generally, a digital circuit can be represented by:
CISC101 Digital Circuits Generally, a digital circuit can be represented by: Remember that an input or output can only be either on (1) or off (0). The gates defined above can be used to design circuits that provide a desired logic. Winter 2018 CISC101 - Prof. McLeod Prof. Alan McLeod

12 For Example: Adding Binary Numbers
How to build a circuit to add binary numbers – called a “one bit full adder”. First: How do you add decimal (base 10) numbers?: Carry digits + Sum Winter 2018 CISC101 - Prof. McLeod

13 Adding Binary Numbers, for Example
The binary numeric system consists of zeros and ones – only. Also called “base 2”. Adding binary numbers: Carry bits + Sum Winter 2018 CISC101 - Prof. McLeod

14 Half Bit Adder Look at the first column of the process:
carry output input 1 + input 2 sum output Winter 2018 CISC101 - Prof. McLeod

15 Half Bit Adder - Cont. Construct a truth table to describe the operation, considering every possible input: input 1 input 2 sum output carry output 1 Which gate produces the sum? The carry? Winter 2018 CISC101 - Prof. McLeod

16 Half Bit Adder - Cont. Write the boolean expressions for the sum output and the carry output: Where “S” is the sum output and “Co” is the carry output. or Winter 2018 CISC101 - Prof. McLeod

17 Half Bit Adder - Cont. Logical diagram for the sum output:
(This is another way to build a “XOR” gate.) not and or Winter 2018 CISC101 - Prof. McLeod

18 Test XOR Gate Logic not and 1 or 1 1 1 1 1 1 1 1 1 Winter 2018
or 1 1 1 1 1 1 1 1 1 Winter 2018 CISC101 - Prof. McLeod

19 Test XOR Gate, Cont. not and 1 or 1 1 1 1 1 Winter 2018
1 or 1 1 1 1 1 Winter 2018 CISC101 - Prof. McLeod

20 Half Bit Adder - Cont. Back to the expression for “S”:
So, S can be generated by an “XOR” gate and Co by an “AND” gate: I1 S I2 Co Winter 2018 CISC101 - Prof. McLeod

21 CISC101 Full Bit Adder Look at one column of the addition process that also adds the carry bit: carry output carry input input 1 + input 2 sum output Winter 2018 CISC101 - Prof. McLeod Prof. Alan McLeod

22 Full Bit Adder - Cont. Construct a logic table to describe what happens - list every input possibility: carry input input 1 input 2 sum output carry output 1 Winter 2018 CISC101 - Prof. McLeod

23 Full Bit Adder - Cont. Create boolean expressions:
Where “I” is input, “Ci” is carry input, “Co” is carry output and “S” is sum output. (Don’t panic! You don’t have to know where these expressions come from and you don’t have to remember them!) Winter 2018 CISC101 - Prof. McLeod

24 Full Bit Adder - Cont. You can write the logical diagram from these expressions as they are but it can be simplified using two “half-bit” adders and an OR gate: Ci S I1 Co I2 Winter 2018 CISC101 - Prof. McLeod

25 Full Bit Adder - Cont. How many transistors required?
AND and OR have 2 each, NOT has 1 (and a resistor) Then XOR must have 8 (2 NOTs, 2 ANDs, 1 OR) Half-bit adder must have 10 (1 XOR, 1 AND) Full-bit adder must have 22 (2 half-bits, 1 OR) Winter 2018 CISC101 - Prof. McLeod

26 N Bit Full Adder Winter 2018 CISC101 - Prof. McLeod

27 N Bit Full Adder – Cont. How many transistors? 22 times N
Integers might occupy 4 bytes or 32 bits for example: 704 transistors, minimum! Just to add two integers! Winter 2018 CISC101 - Prof. McLeod

28 YouTube Video Another presentation of this topic that might help:
Winter 2018 CISC101 - Prof. McLeod

29 Aside - Minecraft Constructions
People with a lot of time on their hands have built adders like these in Minecraft. For example, see the video for this one bit adder: Winter 2018 CISC101 - Prof. McLeod

30 Other Operations So, a full adder can be used to produce a N+1-bit number as the sum of two other N bit numbers. How about multiplication? From Grade 4: 11011  1101 000000 Base 2: 27 13 81 270 351 Base 10: Winter 2018 CISC101 - Prof. McLeod

31 Multiplication, Cont. So what kind of logic would you build to do multiplication of x times y? Create a running sum, s. For each digit, xi: If xi equals 1 then add 2i  y to x. Use a bitwise shift operation to calculate 2i  y (ie. Add a zero to the right of the number). So, an N-bit adder would be used along with some other simple circuits. Winter 2018 CISC101 - Prof. McLeod

32 Summary of Digital Logic
The CPU needs to carry out many other operations than just addition: subtraction comparison multiplication division, etc. Some common functions (trig, exp, log, etc) would work faster if they were hard coded into the processor too. Lots (and lots!) of transistors!! Winter 2018 CISC101 - Prof. McLeod

33 Aside – My Laptop CPU, for Example
Intel Core i7-7500U 2.70 GHz, up to 3.5 GHz. 14 nanometre technology 2 cores, 4 threads per core. 1,750,000,000 transistors. 1,356 pins. Winter 2018 CISC101 - Prof. McLeod

34 “Don’t Worry, Be Happy!” You do not need to be able to design microprocessor circuits! Besides, INTEL and AMD have some fancy programs that do all the work. The purpose of this discussion has been to give you some idea of how an integrated circuit carries out instructions. (Not MAGIC! Just some good technology!) Winter 2018 CISC101 - Prof. McLeod

35 Numeric Representation
Binary numbers or “base 2” is a natural representation of numbers to a computer. As a transition, hexadecimal (or “hex”, base 16) numbers are also used. Octal (base 8) numbers are hardly ever used anymore – so I won’t talk about this base. Decimal (base 10) numbers are not naturally represented in computers. Winter 2018 CISC101 - Prof. McLeod

36 Reminder – Python Integer Literals
From Exercise 1: Binary literals – prefix the number with 0b Octal literals – prefix the number with 0o Hex literals – prefix the number with 0x Decimal literals – don’t prefix the number with anything! Winter 2018 CISC101 - Prof. McLeod

37 Numeric Representation - Cont.
In base 2 (digits either 0 or 1): r=2, a binary number: ( )2= 1×25+1×24+0×23+1×22+0×21+1×20 +1×2-1 +1×2-2 =53.75 (in base 10) “r” is the “radix” or the base of the number Winter 2018 CISC101 - Prof. McLeod

38 Numeric Representation - Cont.
Hexadecimal Numbers: a base-16 system with 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F: For example: r = 16, a hex number: (B65F)16 = 11×163+6×162+5×161+15×160 = Winter 2018 CISC101 - Prof. McLeod

39 Numeric Representation - Cont.
The above series show how you can convert from binary or hex to decimal. How to convert from decimal to one of the other bases? Here is an algorithm that you can use: integral part: divide by r and keep the remainder. decimal part: multiply by r and keep the carry “r” is the base - either 2 or 16 Winter 2018 CISC101 - Prof. McLeod

40 Numeric Representation - Cont.
For example, convert to binary: So, is Divisor(r) Dividend Remainder (quotient) least significant digit most significant digit Winter 2018 CISC101 - Prof. McLeod

41 Numeric Representation - Cont.
For the “0.1510” part: So, is is: ( )2 Multiplier(r) Multiplicand Carry (product) ... Winter 2018 CISC101 - Prof. McLeod


Download ppt "CISC101 Reminders Your group name in onQ is your grader’s name."

Similar presentations


Ads by Google