1 / 28

Building the CPU

CS 1308 – Computer Literacy and the Internet. Building the CPU. It’s Not Magic. The goal of the next series of lectures is to show you exactly how a computer works. We will discuss the logic used to create computer instructions and how the computer decides which instructions to execute.

deannaburns
Download Presentation

Building the CPU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 1308 – Computer Literacy and the Internet Building the CPU

  2. It’s Not Magic • The goal of the next series of lectures is to show you exactly how a computer works. • We will discuss the logic used to create computer instructions and how the computer decides which instructions to execute. • Although at times it may appear to be magical. It’s just math and science.

  3. Data Bus input/ output memory control unit registers arithmetic- logic unit Central Processing Unit (CPU) Our Picture of a Computer

  4. The Reliability of Binary Representation • Electronic devices are most reliable in a bistable environment • Bistable environment • Distinguishing only two electronic states • Current flowing or not • Direction of flow • Computers are bistable: hence binary representations

  5. controlled current controlling current A Switch is a 2-state device that can be toggled A relay is a switch built with an electromagnet when the controlling current is 1, the electromagnet pulls the switch closed, and the controlled current flows through the switch

  6. Switches can do it all • With switches we can implement AND, OR, and NOT gates • With just those types of gates, we can design circuits to perform any computation • Remember, computers do very simple tasks, very quickly

  7. in1 in2 power source out when both inputs are 1, the circuit is closed in1 in2 out 0 0 0 0 1 0 1 0 0 1 1 1 } in1 in2 truth table for AND and out = in1 in2 Basic electric circuits: Computing AND CS 302 - Computer Fluency

  8. in1 in2 out when either input is 1, the circuit is closed in1 in2 out 0 0 0 0 1 1 1 0 1 1 1 1 } in1 in2 truth table for OR or out = in1 + in2 Basic electric circuits: Computing OR

  9. in1 A new type of switch which is closed at rest out } in1 out 0 1 1 0 truth table for NOT in1 not out = in1’ Basic electric circuits: Computing NOT

  10. A better switch: Transistors • bi-stable, solid state device • switching is done electronically, not mechanically • no moving parts; therefore, fast, small, reliable • can switch states in about one 10 billionth of a second • about 5 million transistors can fit on a chip 1 centimeter square. Density is increasing rapidly with new technology.

  11. Figure 4.11 Simplified Model of a Transistor CS 302 - Computer Fluency

  12. Boolean Logic and Gates: Boolean Logic • Boolean logic describes operations on true/false values • True/false maps easily onto bistable environment • Boolean logic operations on electronic signals may be built out of transistors and other electronic devices

  13. Boolean Logic (continued) • Boolean expressions • Constructed by combining together Boolean operations • Example: (a AND b) OR ((NOT b) AND (NOT a)) • Truth tables capture the output/value of a Boolean expression • A column for each input plus the output • A row for each combination of input values

  14. Boolean Logic (continued) • Example: (a AND b) OR ((NOT b) and (NOT a))

  15. Building Computer Circuits: Introduction • A circuit is a collection of logic gates: • Transforms a set of binary inputs into a set of binary outputs • Values of the outputs depend only on the current values of the inputs • Combinational circuits have no cycles in them (no outputs feed back into their own inputs)

  16. A Compare-for-equality Circuit • Compare-for-equality circuit • CE compares two unsigned binary integers for equality • Built by combining together 1-bit comparison circuits (1-CE) • Integers are equal if corresponding bits are equal (AND together 1-CD circuits for each pair of bits)

  17. A Compare-for-equality Circuit (continued) • 1-CE circuit truth table

  18. Figure 4.22 One-Bit Compare for Equality Circuit CS 302 - Computer Fluency

  19. A Compare-for-equality Circuit (continued) • 1-CE Boolean expression • First case: (NOT a) AND (NOT b) • Second case: a AND b • Combined: ((NOT a) AND (NOT b)) OR (a AND b)

  20. Examples Of Circuit Design And Construction • Compare-for-equality circuit • Addition circuit • Both circuits can be built using the sum-of-products algorithm

  21. An Addition Circuit • Addition circuit • Adds two unsigned binary integers, setting output bits and an overflow • Built from 1-bit adders (1-ADD) • Starting with rightmost bits, each pair produces • A value for that order • A carry bit for next place to the left

  22. An Addition Circuit (continued) • 1-ADD truth table • Input • One bit from each input integer • One carry bit (always zero for rightmost bit) • Output • One bit for output place value • One “carry” bit

  23. Figure 4.24 The 1-ADD Circuit and Truth Table

  24. An Addition Circuit (continued) • Building the full adder • Put rightmost bits into 1-ADD, with zero for the input carry • Send 1-ADD’s output value to output, and put its carry value as input to 1-ADD for next bits to left • Repeat process for all bits

  25. Computer Instructions • The logic for every instruction is executed on every cycle by the Arithmetic and Logic Unit (ALU). • The answer used is the one for the instruction that is currently decoded and executed by the CPU. • This selection is done by the Control Circuits.

  26. Control Circuits • Do not perform computations • Choose order of operations or select among data values described by the instruction • The pattern of ones and zeros in each instruction will determine the which result is used from the ALU

  27. Control Circuits (cont.) • Major types of controls circuits • Multiplexors • Select one of inputs to send to output • Decoders • Sends a 1 on one output line, based on what input line indicates CS 1308 – Computer Literacy and the Internet

  28. Summary • Binary values create a bistable environment, making computers reliable • Boolean logic maps easily onto electronic hardware • Circuits are constructed using Boolean expressions as an abstraction • Computational and control circuits may be built from Boolean gates

More Related