Download presentation
1
Chapter 0 Introduction to Computing
2
Section 0.1 Numbering and Coding Systems
3
Outlines of Section 0.1 Decimal and binary number systems
2017/4/17 Outlines of Section 0.1 Decimal and binary number systems Converting between decimal to binary Hexadecimal system Converting between binary and hex Counting in bases 10, 2, and 16 Addition and subtraction of hex number ASCII codes Please review the items if you have forgotten them. A printer is an example of embedded system since the processor inside it performs one task only.
4
Section 0.2 Digital Primer
5
Outlines of Section 0.2 Binary Logic
2017/4/17 Outlines of Section 0.2 Binary Logic Logic Gates - AND, OR, NOT, XOR, NAND, NOR Logic design using gates Decoders Flip-flops Please review the items if you have forgotten them. A printer is an example of embedded system since the processor inside it performs one task only.
6
Section 0.3 Inside the Computer
7
Important Terminology
Bit Nibble (4 bits) Byte (8 bits) Word (32 bits) KB (kilobyte)=210 bytes MB (megabyte)=220 bytes GB (gigabyte)=230 bytes TB (terabyte)=210 bytes
8
ROM v.s. RAM ROM (read only memory) RAM (random access memory)
2017/4/17 ROM v.s. RAM ROM (read only memory) ROM contains programs and information essential to operation of the computer. for permanent data which cannot changed by the user called as nonvolatile memory Data does not lost when power off RAM (random access memory) for temporary storage of programs that it is running Data lost when power off called as volatile memory ROM: permanent information tables for character patterns to be displayed on the video monitor, the programs for testing and finding the total amount of RAM installed on the system programs to display information on the video monitor. BIOS RAM: not permanent, data change with time various versions of the OS application packages: office word, tax calculation packages
9
Figure 0-9: Inside the Computer
2017/4/17 Figure 0-9: Inside the Computer Every computer can be broken down into three parts: CPU (Central Processing Unit) Memory:RAM,ROM, etc. I/O (Input/Output) devices:Peripherals CPU: execute information stored in memory. I/O device: provide a means of communicating with the CPU. Address Bus Peripherals (monitor, printer, etc.) CPU Memory (RAM, ROM, ) Data Bus Control Bus
10
Bus CPU is connected to memory and I/O through strips of wire called a bus. Buses are used to Communicate between the computer components. Data Bus Address Bus Control Bus Control bus Address bus I/O device CPU Memory Data bus
11
2017/4/17 The Operation of Bus For a device (memory or I/O) to be recognized by the CPU, it must be assigned an address. The address of every device must be unique. The CPU puts the address on the address bus, and the decoding circuitry finds the device. The CPU uses the data bus either to get data form that device or to send data to it. The control buses are used to provide read or write signals. The address bus and data bus determine the capacity of a given CPU.
12
Data Bus The more data buses available, the better the CPU.
2017/4/17 Data Bus The more data buses available, the better the CPU. Example:8 bits(slow), 16 bits, 32 bits, 64 bits(fast). An 8-bit data bus can send 1 byte a time. Data buses are bi-directional. More data buses mean a more expensive CPU and computer. The processing power of a computer is related to the size of its buses. Data bus is like a highway. More data buses available (increasing the number of lanes 路徑) provide a better pathway between the CPU and its external devices. 8 lines for a 8-bit bus
13
2017/4/17 Address Bus The more address buses available, the larger the number of devices that can be addresses. Example:8 bits(slow), 16 bits, 32 bits, 64 bits(fast). A 16-bit address bus can indicate 216=64K bytes of addressable memory. Regardless of the size of the data bus. Address buses are unidirectional. The number of address lines determines the number of locations with which a CPU can communicate. All general purpose microprocessor CPUs are what is called byte addressable. Ask, 8 bit address bus can indicate 28=256 memory cells. Ask, IBM PC AT uses a CPU with 24 address lines and 16 data lines. The total accessible memory is 224=16 MB. CPU can access 2 bytes per clock.
14
Central Processing Unit (CPU)
Arithmetic/logic unit (ALU): to perform the arithmetic and logic operation Control unit: coordinating the machine’s activities Registers: to store temporary data Figure 2-1
15
Registers General-purpose registers Special-purpose registers
A,B,R0,R1,R2,... Register banks: a set of registers (R0..R7) Special-purpose registers Program Counter (PC) Instruction Register (IR) Program Status Word (PSW)
16
The Registers of Computer
2017/4/17 The Registers of Computer Workspace R0 General Registers R1 Instructions R2 ... S Special Registers IR PC PSW
17
Machine Clock One bit is send on a wire in a clock period.
Clock is used to synchronize work of the components on the machine. Clock decides the performance of the computer. a clock 10 1.4 GHz
18
The Machine Cycle(1/2) Every instruction in memory is executed by three steps: Fetch Decode Execute Each instruction has its micro-instruction (or micro-operations). A micro-operation is an elementary operation that can be performed in parallel during one clock pulse period. CPU has separate inside units for performing fetch/decode/execution. The instruction decoder is to interpret the instruction fetched into the CPU.
19
2017/4/17 The Machine Cycle(2/2) by instruction decoder by ALU
20
Internal Organization of Computers Example
8-bit data bus 16-bit address (for a total of 10000H locations) address 0000-FFFFH Address Bus CPU read /write RAM ROM Printer Disk Monitor Keyboard Data Bus Control Bus Figure 0-10 Internal Organization of Computers
21
Program Example Action Code Data
Move value 21H into register A B0H H Add value 42H to register A H H Add value 12H to register A H H
22
Inside Memory 1400 B0 code for moving a value into register A
Memory address Contents Meaning B code for moving a value into register A value to be moved code for adding a value to register A value to be added code for adding a value to register A value to be added code for halt
23
Actions Performed by the CPU(1/3)
The PC is set to the value 1400H, indicating the address of the first instruction code to be execution. The CPU puts 1400H on the address bus and sent it out. The PC is added by 1. The memory circuitry finds 1400H while the CPU activates the READ signal, indicating to memory that CPU wants the byte at location 1400H. The content of memory location 1400H, which is B0, to be put on the data bus and brought into the CPU. The CPU decodes the instruction B0. PC=1400 PC=1401 PC=1401, IR=B0
24
Actions Performed by the CPU(2/3)
The CPU performs the moving instruction: The control circuitry ask the content from memory location 1401 (saved in PC). The PC is added by 1. Put the value 21H to register A. After completing one instruction, the PC points to the address of the next instruction to be execute (i.e., 1402H.) From the memory location 1402H. The CPU fetches code 04H. The PC add 1. The CPU decoding 04H and ask the parameter in 1803H. The PC add 1. A = ?, PC=1402, IR=B0 A = 21H, PC=1402, IR=B0 A = 21H, PC=1403, IR=04 A = 21H, PC=1404, IR=04
25
Actions Performed by the CPU(3/3)
The ALU executes the add instruction and sets the value 63H to register A. From the memory location 1404H, CPU fetches code 04H. The CPU decoding it and ask the parameter. The ALU executes the add instruction and sets the value 74H to register A. The content of address 1406 are fetched in and executed. This HALT instruction tells the CPU to stop incrementing PC and asking for the next instruction. A = 63H, PC=1404, IR=04 A = 74H, PC=1406 IR=04 A = 74H, PC=1407, IR=00
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.