Download presentation
Presentation is loading. Please wait.
Published byAda Ferguson Modified over 8 years ago
1
Lecture # 36 Computer Architecture and Organization
2
Computer Hardware What goes on inside?
3
A Computer
4
Parts of a Computer 1.Monitor 2.Motherboard 3.CPU 4.Main Memory (RAM) 5.Expansion Cards 6.Power supply 7.CD/DVD/Blu-ray 8.Hard drive 9.Keyboard 10.Mouse
5
Inside a Computer
6
The Motherboard
7
CPU and Memory Communication Central Processing Unit CPU Memory Address Data What is the maximum amount of memory? What is bandwidth?
8
New Intel Architecture
9
I/O Connections Graphics USB – anything Keyboard Mouse USB drive PCI slots Network card Hard Disk (SATA)
10
Persistent Storage Unplug your machine – the information is gone How do we keep it then? –Magnetic storage Hard Disk Mag tape –USB drive –Optical drive
11
Magnetic Storage
12
How It Works Moving a magnet past a wire creates electricity Sending electricity through a wire creates a magnet
13
Magnetic storage Hi How do we know where one character ends and the next begins? Count to 8
14
Magnetic storage Hi S
15
Magnetic storage Hi S N
16
Magnetic storage Hi S N S
17
Magnetic storage Hi S N S S
18
Magnetic storage Hi S N S S N
19
Magnetic storage Hi S N S
20
Magnetic storage Hi S N S S N S S
21
Magnetic storage Hi S N S S N S S N
22
Magnetic storage Hi S N S S N S S N S
23
Magnetic storage Hi S N S S N S S N S N
24
Magnetic storage Hi S N S S N S S N S N N
25
Magnetic storage Hi S N S S N S S N S N N S
26
Magnetic storage Hi S N S S N S S N S N N S N
27
Magnetic storage Hi S N S S N S S N S N N S N S
28
Magnetic storage Hi S N S S N S S N S N N S N S S
29
Magnetic storage Hi S N S S N S S N S N N S N S S N
30
Magnetic Storage Reading Hi S N S S N S S N S N N S N S S N - do the opposite direction
31
Magnetic Disks Spin disk instead of move tape Multiple tracks on the disk Move the head in and out Track Sector
32
Magnetic Disks How long to read or write? How fast does it spin –5400, 7200, 10000, 15000 RPM How many bits on a track How long to move the head
33
Magnetic Disks How much can it hold? Make the disk bigger Make the bits smaller –Less area = less magnetism Put the heads closer –Disk vibration –Make it hard instead of flexible –Vacuum seal it to keep out dust Make the head move less distance
34
CD-ROM Laser Sensor 1
35
CD-ROM How fast can it spin How big are the pits –Scratches Laser Sensor 0
36
Keyboard Key code = 52Key code = 131 How do you translate key codes into ASCII? Use an array indexed by key code What about the shift key? Use two arrays How do you translate key codes into Unicode? Use a different array
37
Keyboard What about Cyrillic, Hebrew or Arabic? Change the key caps Change the keycode->Unicode array
38
Mouse Software maintains –X and Y Optical sensor (IR, LED, Laser) –Up - subtract 1 from Y –Down - add 1 to Y –Left - add 1 to X –Right - subtract 1 from X
39
Display Numbers tell display how bright each spot should be Controller lets CPU change the number for each spot Controller
40
Toy Computer http://students.cs.byu.edu/~cs100/cgi/Machine.html Show several of the built in programs Show simple command –Load Load Immediate –Store –Add/Sub –Mult/Div –Print –Skip –JMP
42
Deeper
44
Not that deep
45
A simple Computer Central Processing Unit CPU Performs all calculations and decisions Add, Subtract, … >, <, == decide what to do next
46
A simple Computer Central Processing Unit CPU Memory Stores most information Memory is a large array of integers
47
Memory - array of integers How does it store text? How does it store images? How does it store audio? How does it store a program?
48
A simple Computer Central Processing Unit CPU Memory Address Wires that pass the index of the location in memory that the CPU wants to get or change
49
A simple Computer Central Processing Unit CPU Memory Address Wires that pass the index of the location in memory that the CPU wants to get or change 0 1 0 0 1 0
50
A simple Computer Central Processing Unit CPU Memory Address Number of wires = number of bits Number of bits = range of possible indexes = total possible memory 0 1 0 0 1 0
51
A simple Computer Central Processing Unit CPU Memory Address Twice as much memory adds how many more address wires? 1 more 0 1 0 0 1 0
52
A simple Computer Central Processing Unit CPU Memory Address Data Wires that pass numbers from CPU to Memory or from Memory to CPU
53
A simple Computer Central Processing Unit CPU Memory RAM Address Data RAM - Random Access Memory is the main memory of a computer. The size of RAM is the length of the array
54
How to represent a program in memory Program is a series of simple instructions –Each instruction is an integer CPU –Goes to a location in memory –Gets an instruction –Does what the instruction says –Moves to the next instruction Does this millions of times per second
55
A simple fake computer CPU
56
Program Counter - address (index) of the next instruction
57
Registers private memory for the CPU
58
Every instruction has a number OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0!
59
Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0!
60
Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0! 3 1 10
61
Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0! 3 1 10
62
Reg[1]=Reg[1]+Mem[10] Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0! 3 1 10
63
? Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0! 4 2 30
64
Reg[2]=Reg[2]-Mem[30] Instruction Format: Digit 1 OpCode Digit 2 Register Digit 3-4 Memory Address OpCodes 0 - Halt 1 - Load 2 - Store 3 - Add 4 - Subtract 5 - Divide 6 - Multiply 7 - Is Greater Than 0? 8 - Goto 9 - Branch If Greater Than 0! 4 2 30
65
A simple program 1 0 07 Load location 7 into register 0 Reg[0]=Mem[7] PC = PC+1
66
A simple program 1 2 08 Load location 8 into register 2 Reg[2]=Mem[8] PC = PC+1
67
A simple program 3 0 07 Add location 7 to register 0 Reg[0]=Reg[0]+Mem[7] PC = PC+1
68
A simple program 8 2 00 GOTO the address stored in register 2 PC = Reg[2]
69
A simple program 3 0 07 Add location 7 to register 0 Reg[0]=Reg[0]+Mem[7] PC=PC+1
70
A simple program 8 2 00 GOTO the address stored in register 2 PC = Reg[2]
71
A simple program 3 0 07 Add location 7 to register 0 Reg[0]=Reg[0]+Mem[7] PC=PC+1
72
Clock speed of a processor Number of instructions per second that can be performed 100 MHz = 100 Million instructions per second 1.5 GHz = 1.5 Billion instructions per second
73
So what is a program? A file of bytes Operating system copies the file into memory –When select the program from Start menu –When you double click on the program Operating system sets PC to address of first byte of the program in memory Program begins to run
74
Programs and Data Program (instructions) Data What is the difference? If the PC points to it then it is an instruction
75
Review CPU - Central Processing Unit –Does calculating and deciding Memory - RAM –Stores data and programs –Array of integers –Size of RAM = the length of this array
76
Review Program –List of instructions –Each instruction is an integer that the CPU decodes –Program counter (PC) is the address of the next instruction Copy program from file into memory –Set PC to start of the program
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.