Presentation is loading. Please wait.

Presentation is loading. Please wait.

Concepts of Engineering and Technology Copyright © Texas Education Agency, 2012. All rights reserved.

Similar presentations


Presentation on theme: "Concepts of Engineering and Technology Copyright © Texas Education Agency, 2012. All rights reserved."— Presentation transcript:

1 Concepts of Engineering and Technology Copyright © Texas Education Agency, 2012. All rights reserved.

2 Basic Electricity and Electronics Module Three Microprocessor Basics Copyright © Texas Education Agency, 2012. All rights reserved.

3 An Inverter Lets go back to our first transistor circuit: Lets go back to our first transistor circuit: V CC VOVO VIVI ground RCRC V I = 0, the transistor is off, V O = V CC (+ 5 V) V I = 1, the transistor is on, V O = 0 (ground) Copyright © Texas Education Agency, 2012. All rights reserved.

4 An Inverter VIVI V CC RERE Don’t like the inverter? Here is a circuit that does not invert Copyright © Texas Education Agency, 2012. All rights reserved.

5 We have established the concept that voltage turns on or off transistors We have established the concept that voltage turns on or off transistors We use transistors to make the circuits that do what we need We use transistors to make the circuits that do what we need What circuit do we need to make a binary adder? What circuit do we need to make a binary adder? First, let’s look at what the adder circuit has to do: First, let’s look at what the adder circuit has to do: Copyright © Texas Education Agency, 2012. All rights reserved.

6 The OR gate When ANY input is high, the output goes high When ANY input is high, the output goes high Does not perfectly match what we need, but gives us a starting point Does not perfectly match what we need, but gives us a starting point A B If EITHER input goes high, the transistor turns on This is called an OR gate Copyright © Texas Education Agency, 2012. All rights reserved.

7 This circuit works better This circuit works better The diodes protect one input from the other The diodes protect one input from the other The resistor limits current The resistor limits current A B Copyright © Texas Education Agency, 2012. All rights reserved.

8 Truth Table The truth table for the OR gate: The truth table for the OR gate: When ANY input is high, the output is high When ANY input is high, the output is high A B Q ABQ 001101010111 Schematic symbol (Or X) Copyright © Texas Education Agency, 2012. All rights reserved.

9 The AND Gate When BOTH inputs are high, we produce a carry When BOTH inputs are high, we produce a carry We need a circuit that will turn on only when both inputs are on We need a circuit that will turn on only when both inputs are on ABQ 001101010001 RERE B V CC A Q Schematic symbol Copyright © Texas Education Agency, 2012. All rights reserved.

10 Schematic Symbols We have seen the schematic symbols for 2 gates: We have seen the schematic symbols for 2 gates: AND AND OR OR Here is the schematic symbol for the inverter: Here is the schematic symbol for the inverter: NOT NOT With these three gates, you can make any logic circuit With these three gates, you can make any logic circuit Copyright © Texas Education Agency, 2012. All rights reserved.

11 Back to the Adder Here is how we make a binary adder: Here is how we make a binary adder: All circuits are made physically with transistors, but represented by symbols All circuits are made physically with transistors, but represented by symbols A B Σ (sum) C O (carry)ABΣ CoCoCoCo0011010101100001 Copyright © Texas Education Agency, 2012. All rights reserved.

12 Digital Logic Digital logic is used for circuit design Digital logic is used for circuit design Also used for mathematical operations Also used for mathematical operations Called “Boolean Algebra” Called “Boolean Algebra” The English language use of the terms “and,” “or,” “not” do not always have the same meaning as the logical terms The English language use of the terms “and,” “or,” “not” do not always have the same meaning as the logical terms There are 7 total logic gates There are 7 total logic gates AND, OR, NOT, NAND, NOR, Exclusive-OR, Exclusive-NOR AND, OR, NOT, NAND, NOR, Exclusive-OR, Exclusive-NOR These gates are the building blocks for computers These gates are the building blocks for computers Copyright © Texas Education Agency, 2012. All rights reserved.

13 Logic Circuit Applications A memory decoder A memory decoder A memory address is a unique number A memory address is a unique number Most logic circuits are simple, as this example shows Most logic circuits are simple, as this example shows A 2-bit code unlocks one of 4 memory locations when D goes high A 4-bit code would unlock one of 16 memory locations when D goes high Copyright © Texas Education Agency, 2012. All rights reserved.

14 3 Bit Decoder Any 3 bit binary number enables one AND gate Any 3 bit binary number enables one AND gate A0A0 A1A1 A2A2 D 0 = 0 0 0 D 1 = 0 0 1 D 3 = 0 1 1 D 2 = 0 1 0 D 4 = 1 0 0 D 5 = 1 0 1 D 6 = 1 1 0 D 7 = 1 1 1 Copyright © Texas Education Agency, 2012. All rights reserved.

15 A0A0 A1A1 A2A2 A3A3 A4A4 A5A5 765BA98432102929 3737 3636 3535 34343 3232 3131 2828 3030 3838 3939 3A3A 3B3B 3C3C 3D3D 3E3E 3F3F 2323 2424 2525 2626 2727 2F2F 2E2E 2D2D 2C2C 2B2B 2A2A 10101 1B1B 1A1A 1919 1818 2020 2121 2 1D1D 1414 1C1C C1313 1212 1616 1515 1E1E 1F1F FE1717 D 6 address lines, 16 AND gates and 6 inverters enable 64 memory locations Copyright © Texas Education Agency, 2012. All rights reserved.

16 Computer Basics A computer uses voltage on wires to communicate A computer uses voltage on wires to communicate Communication involves data, addresses, and instructions Communication involves data, addresses, and instructions Each of these are represented by binary numbers in a code Each of these are represented by binary numbers in a code A logic circuit similar to what we have just seen is used to decode each of these A logic circuit similar to what we have just seen is used to decode each of these Copyright © Texas Education Agency, 2012. All rights reserved.

17 A computer has several basic parts The input unit The input unit Keyboard, mouse, modem, transducer Keyboard, mouse, modem, transducer The output unit The output unit Monitor, printer, modem Monitor, printer, modem Memory Memory RAM, hard drive, CD-ROM RAM, hard drive, CD-ROM CPU CPU Central processing unit Central processing unit Also called a microprocessor Also called a microprocessor Copyright © Texas Education Agency, 2012. All rights reserved.

18 The CPU The CPU is also called the microprocessor The CPU is also called the microprocessor The brains of the computer The brains of the computer Performs arithmetic and logic Performs arithmetic and logic Has an internal ALU Has an internal ALU Works based on an internal program called microcode Works based on an internal program called microcode The primary job of a CPU is to execute instructions The primary job of a CPU is to execute instructions Copyright © Texas Education Agency, 2012. All rights reserved.

19 Instructions Where do instructions come from? Where do instructions come from? Humans write programs Humans write programs A program is made by a series of instructions A program is made by a series of instructions Instructions are processed sequentially Instructions are processed sequentially Program instructions get decoded Program instructions get decoded An instruction set is used for a family of microprocessors An instruction set is used for a family of microprocessors Copyright © Texas Education Agency, 2012. All rights reserved.

20 Most program instructions are simple: load, store, move, add Most program instructions are simple: load, store, move, add The type of program a CPU understands is called machine code The type of program a CPU understands is called machine code A higher level language like C or Java is compiled or interpreted into machine language A higher level language like C or Java is compiled or interpreted into machine language Each instruction the computer understands is represented by a binary number Each instruction the computer understands is represented by a binary number Copyright © Texas Education Agency, 2012. All rights reserved.

21 A logic circuit similar to what we have seen decodes the instruction into a particular sequence of internal operations A logic circuit similar to what we have seen decodes the instruction into a particular sequence of internal operations To decode CD audio, a program runs in the computer To decode CD audio, a program runs in the computer The program describes how to read the data from the CD and what to do with the data when it is read The program describes how to read the data from the CD and what to do with the data when it is read The CD audio data is also a series of numbers The CD audio data is also a series of numbers Voltage on wires is used to represent the numbers (data, instructions, and addresses) Voltage on wires is used to represent the numbers (data, instructions, and addresses) Copyright © Texas Education Agency, 2012. All rights reserved.

22 If you look at a motherboard, you can see all the wires that are used to communicate If you look at a motherboard, you can see all the wires that are used to communicate Wires are grouped and separated by function Wires are grouped and separated by function A group of wires is called a BUS A group of wires is called a BUS For example, a 32 bit address bus is a group of 32 wires that connects chips For example, a 32 bit address bus is a group of 32 wires that connects chips CPU to RAM CPU to RAM CPU to devices/expansion slots CPU to devices/expansion slots Copyright © Texas Education Agency, 2012. All rights reserved.

23 Addresses go on an address bus Addresses go on an address bus Data goes on a data bus Data goes on a data bus On a motherboard, the two are separate physically On a motherboard, the two are separate physically Other buses are: the control bus and the power bus Other buses are: the control bus and the power bus Program instructions are a form of data Program instructions are a form of data Data and program instructions are sent at different times on the same wires Data and program instructions are sent at different times on the same wires Copyright © Texas Education Agency, 2012. All rights reserved.

24 Examples of control signals Clock and timing signals Clock and timing signals Memory read or write Memory read or write Memory vs. other input/output types Memory vs. other input/output types RAM vs keyboard/mouse RAM vs keyboard/mouse Ready to send/clear to send/interrupt Ready to send/clear to send/interrupt Enable/disable Enable/disable These are all on/off, controlled by voltage on a wire These are all on/off, controlled by voltage on a wire Copyright © Texas Education Agency, 2012. All rights reserved.

25 The Clock The clock does two basic things: The clock does two basic things: Tells when to start Tells when to start Like a starters pistol Like a starters pistol Starts on an edge of the clock signal Starts on an edge of the clock signal Tells how long an operation lasts Tells how long an operation lasts The duration The duration A half hour show vs. a one hour show A half hour show vs. a one hour show How long things take can determine clock rates How long things take can determine clock rates Copyright © Texas Education Agency, 2012. All rights reserved.

26 The Clock The clock signal is used to synchronize all microprocessor operations Start Duration (One Clock Cycle) Start of next cycle or process Time Elapses (Like ticks of a clock) Copyright © Texas Education Agency, 2012. All rights reserved.

27 CPU Block Diagram Clock ALU Program Counter Stack Bus Controller Data Bus Address Bus Memory Input/ Output Instruction Register Data Register Instruction Decoder 10010111 1001011101 Copyright © Texas Education Agency, 2012. All rights reserved.

28 Key Facts The data bus is bi-directional The data bus is bi-directional The address bus is uni-directional The address bus is uni-directional The program counter holds the address of the next memory location to be used The program counter holds the address of the next memory location to be used The next address is the last address + 1 The next address is the last address + 1 The stack holds the addresses of programs and data the CPU is not currently using The stack holds the addresses of programs and data the CPU is not currently using Internal registers form a queue of program instructions and data Internal registers form a queue of program instructions and data Copyright © Texas Education Agency, 2012. All rights reserved.

29 A Program Example Lets go through an example of the steps a CPU goes through to read CD data Lets go through an example of the steps a CPU goes through to read CD data A program is a series of instructions A program is a series of instructions A program loops over and over again A program loops over and over again What is the program doing while it loops? What is the program doing while it loops? Waiting for user input Waiting for user input Generating routine output Generating routine output Handshaking with devices Handshaking with devices Video output Video output Copyright © Texas Education Agency, 2012. All rights reserved.

30 Step One The address in the program counter gets put on the address bus The address in the program counter gets put on the address bus This address is for a program instruction in RAM This address is for a program instruction in RAM A read control signal is placed on the control bus A read control signal is placed on the control bus The program instruction code from memory is placed on the data bus The program instruction code from memory is placed on the data bus The program counter adds one to the old address The program counter adds one to the old address The CPU reads the instruction and executes whatever is necessary to perform the instruction The CPU reads the instruction and executes whatever is necessary to perform the instruction Copyright © Texas Education Agency, 2012. All rights reserved.

31 Step 2 The next address (which is the old address plus 1) gets placed on the address bus The next address (which is the old address plus 1) gets placed on the address bus A read control signal is placed on the control bus A read control signal is placed on the control bus The program instruction at that address is placed on the data bus The program instruction at that address is placed on the data bus The program counter adds one to the old address The program counter adds one to the old address The CPU reads the instruction, decodes it, and executes it The CPU reads the instruction, decodes it, and executes it This instruction tells the CPU to read data from the CD This instruction tells the CPU to read data from the CD Copyright © Texas Education Agency, 2012. All rights reserved.

32 Step 3 The address in the program counter is placed on the stack The address in the program counter is placed on the stack The CPU determines the next available free memory location, and places that address in the program counter The CPU determines the next available free memory location, and places that address in the program counter This address is placed on the address bus This address is placed on the address bus A write control signal is placed on the control bus A write control signal is placed on the control bus The CD drive reads data off the CD disk and loads the data into memory at the location in the PC The CD drive reads data off the CD disk and loads the data into memory at the location in the PC A one (1) is added to the address in the program counter A one (1) is added to the address in the program counter The next piece of data is loaded into the next memory location, etc. The next piece of data is loaded into the next memory location, etc. Copyright © Texas Education Agency, 2012. All rights reserved.

33 Next Steps When the CPU wants to go back to running the program, the current data location is taken from the program counter and placed on the stack, the next program instruction is taken off the stack and loaded back into the program counter When the CPU wants to go back to running the program, the current data location is taken from the program counter and placed on the stack, the next program instruction is taken off the stack and loaded back into the program counter Data and program instruction memory locations are stored on the stack Data and program instruction memory locations are stored on the stack Only current program addresses (or data locations) are in the program counter Only current program addresses (or data locations) are in the program counter Copyright © Texas Education Agency, 2012. All rights reserved.

34 CD Data to Audio A CD that can read data at 52X can read data off the disk at 7.8 million bytes/sec A CD that can read data at 52X can read data off the disk at 7.8 million bytes/sec 1X is 150 KB/sec 1X is 150 KB/sec CD audio data is recorded and reproduced at exactly 176,400 bytes/sec CD audio data is recorded and reproduced at exactly 176,400 bytes/sec 44,100 samples/sec X 2 bytes/samples X 2 channels 44,100 samples/sec X 2 bytes/samples X 2 channels Excess data is buffered in memory Excess data is buffered in memory Binary data is processed by converting each 16 bit number to a voltage with a signal amplitude given by the data numerical value Binary data is processed by converting each 16 bit number to a voltage with a signal amplitude given by the data numerical value The voltage is sent to the speaker, which produces sound The voltage is sent to the speaker, which produces sound Copyright © Texas Education Agency, 2012. All rights reserved.


Download ppt "Concepts of Engineering and Technology Copyright © Texas Education Agency, 2012. All rights reserved."

Similar presentations


Ads by Google