Vous êtes sur la page 1sur 29

Basic Computer Architecture

*Basic Microcomputer Design


• clock synchronizes CPU operations
• control unit (CU) coordinates sequence of execution steps
• ALU performs arithmetic and bitwise processing

data bus

registers

I/O I/O
Central Processor Unit Memory Storage
Device Device
(CPU) Unit
#1 #2

ALU CU clock

control bus

address bus

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 2


*Basic Microcomputer Design
• Memory Storage Unit: primary memory
• I/O Devices: Input/Output devices
• Data bus: moves data between memory/i/o and registers
• Control bus: determines where data comes from and goes, and
ALU activities
• Address bus: selects where data comes from or goes to
data bus

registers

I/O I/O
Central Processor Unit Memory Storage
Device Device
(CPU) Unit
#1 #2

ALU CU clock

control bus

address bus

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 3


**Clock
• *synchronizes all CPU and BUS operations
• machine (clock) cycle measures time of a single
operation
• *clock is used to trigger events

one cycle

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 4


Instruction Execution Cycle

• *Fetch
• *Decode
• *Fetch operands
• *Execute
• *Store output

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 5


Reading from Memory
• Multiple machine cycles are required when reading from memory,
because it responds much more slowly than the CPU. The steps are:
• Cycle 1: address placed on address bus
• Cycle 2: Read Line (RD) set low
• Cycle 3: CPU waits one cycle for memory to respond
• Cycle 4: Read Line (RD) goes to 1, indicating that the data is on the
data bus
Cycle 1 Cycle 2 Cycle 3 Cycle 4

CLK

Address
ADDR

RD

Data
DATA

6
Cache Memory

• High-speed expensive static RAM both inside and


outside the CPU.
• Level-1 cache: inside the CPU
• Level-2 cache: outside the CPU
• Cache hit: when data to be read is already in cache
memory
• Cache miss: when data to be read is not in cache
memory.

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 7


*How a Program Runs
User

sends program
name to

Operating searches for Current


system program in directory

gets starting
cluster from returns to
System
loads and path
starts
Directory Program
entry

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 8


*Multitasking
• OS can run multiple programs at the same time.
• Multiple threads of execution within the same
program.
• Scheduler utility assigns a given amount of CPU time
to each running program.
• Rapid switching of tasks
• gives illusion that all programs are running at once
• the processor must support task switching.

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 9


Components of an IA-32 Microcomputer

• *Motherboard
• *Video output
• *Memory
• *Input-output ports

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 10


*Motherboard (printed circuit board)
• Heart of a Microcomputer
• CPU socket: provides the mechanical and electrical
connections
• External cache memory and main memory slots
• BIOS (Basic Input-Output System) chips
• Connections for mass storage devices (hard drives,
CD-RONs)
• USB connectors for external devices
• Keyboard and mouse ports
• PCI bus connectors (expansion cards) for sound
cards, graphics cards, data acquisition boards, other
i/o devices

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 11


*Motherboard
Optional
• Sound synthesizer chip
• Video controller chip
• IDE, parallel, serial, video, joystick, network, and
connectors
• PCI bus connectors (expansion cards)
• Integrated network adapter
• AGP bus connector for a high-speed video card

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 12


Important Support Processors
• Floating-Point Unit (FPU)
• 8284/82C284 Clock Generator (clock)
• 8259A Programmable Interrupt Controller (PIC)
• Handles interrupts from external devices
• 8253 Programmable Interval Timer/Counter
• Interrupts system 18.2 times/second
• Updates system date and clock
• Controls the speaker
• Refreshes RAM memory chips
• 8255 Programmable Parallel Port
• Transfers data to and from the computer
• Commonly used for printers as well as other i/o devices
Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 13
Intel D850MD Motherboard mouse, keyboard,
parallel, serial, and USB
Video
connectors
Audio chip

PCI slots
memory controller hub
Pentium 4 socket
AGP slot

dynamic RAM

Firmware hub

I/O Controller
Speaker Power connector
Battery
Diskette connector
Source: Intel® Desktop Board D850MD/D850MV Technical Product IDE drive connectors
Specification
Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 14
*PCI and PCI Express Bus Architecture
• Peripheral Component Interconnect (PCI) bus
• Connecting bridge between CPU and other system
devices
• Memory, hard drives, video controllers, sound cards, and
network controllers
• Provides two-way serial connections between
• Devices, memory, and the processor
• Caries data in packets similar to networks
• Widely supported by graphics controllers
• Transfer rate about 4 Gbytes/second

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 15


Intel 965 Express Chipset

• Collection of
processor chips
designed to work
together on a specific
type of motherboard
• P965 used in
desktop PC with
either a Core 2 Duo
or Pentium D
processor

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 16


Intel 965 Express Chipset

• Some features of
P965
• Fast Memory
Access
• I/O Controller
Hub (ICH8/R/DH)
• Supports 10 USB
ports, six PCI
express slots and
networking
• High definition
audio chip

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 17


*Video Output

• Video controller
• on motherboard, or on expansion card
• AGP (accelerated graphics port technology)*
• Video memory (VRAM)
• Video CRT Display
• uses raster scanning
• horizontal retrace
• vertical retrace
• Direct digital LCD monitors
• no raster scanning required

* This link may change over time.

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 18


Sample Video Controller (ATI Corp.)

• 128-bit 3D graphics
performance powered by
RAGE™ 128 PRO
• 3D graphics performance
• Intelligent TV-Tuner with
Digital VCR
• TV-ON-DEMAND™
• Interactive Program Guide
• Still image and MPEG-2 motion
video capture
• Video editing
• Hardware DVD video playback
• Video output to TV or VCR

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 19


*Memory
• ROM
• read-only memory
• EPROM
• erasable programmable read-only memory
• Dynamic RAM (DRAM)
• inexpensive; must be refreshed constantly
• Static RAM (SRAM)
• expensive; used for cache memory; no refresh required
• Video RAM (VRAM)
• dual ported; optimized for constant video refresh
• CMOS RAM
• complimentary metal-oxide semiconductor
• system setup information
• See: Intel platform memory (Intel technology brief: link address may
change)

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 20


*Input-Output Ports
• USB (universal serial bus)
• intelligent high-speed connection to devices
• up to 12 megabits/second
• USB hub connects multiple devices
• enumeration: computer queries devices
• supports hot connections

Computer
A
B B
Scanner A
A B
Hub Printer
A
Camera
B

A B
Hub Device
Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 21
*Input-Output Ports

• Parallel
• short cable, high speed
• common for printers
• bidirectional, parallel data transfer
• Intel 8255 controller chip

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 22


*Input-Output Ports (cont)

• Serial
• RS-232 serial port
• one bit at a time
• uses long cables and modems
• 16550 UART (universal asynchronous receiver
transmitter)
• programmable in assembly language

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 23


Device Interfaces

• ATA host adapters


• intelligent drive electronics (hard drive, CDROM)
• SATA (Serial ATA)
• inexpensive, fast, bidirectional
• FireWire
• high speed (800 MB/sec), many devices at once
• Bluetooth
• small amounts of data, short distances, low power
usage
• Wi-Fi (wireless Ethernet)
• IEEE 802.11 standard, faster than Bluetooth

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 24


*Levels of Input-Output
• Level 3: High-level language functions
• examples: C++, Java
• portable, convenient, not always the fastest
• Level 2: Operating system
• Application Programming Interface (API) library
• Writing strings to files, reading strings from keyboard,
allocating blocks of memory
• extended capabilities, lots of details to master
• Level 1: BIOS
• drivers that communicate directly with devices
• OS security may prevent application-level code from working
at this level

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 25


Device Drivers
• Programs that permit the OS to communicate
directly with hardware devices
• Simplifies programming by acting as translator
between a hardware device and the applications or
operating systems that use it
• Programmers can write the higher-level application
code independently of whatever specific hardware
the end-user is using

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 26


Displaying a String of Characters
When a HLL program displays a string
Application Program Level 3
of characters, the following steps take
place:
OS Function Level 2
• Level 1: The library function calls an
operating system function, passing a
string pointer.
BIOS Function Level 1 • Level 2: The operating system
function uses a loop to call a BIOS
subroutine, passing it the ASCII
Hardware Level 0
code and color of each character.
The operating system calls another
BIOS subroutine to advance the
cursor to the next position on the
screen.
Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 27
Displaying a String of Characters

Application Program Level 3 • Level 1: The BIOS subroutine


receives a character, maps it to a
particular system font, and sends
OS Function Level 2 the character to a hardware port
attached to the video controller card.
• Level 0: The video controller card
BIOS Function Level 1
generates timed hardware signals to
the video display that control the
raster scanning and displaying of
Hardware Level 0
pixels.

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 28


Tradeoffs
• Control versus portability
• Level 2 works on any computer running the same
operating system, but is not particularly fast because
each I/O call must go through several layers before it
executes
• Level 1 works on all systems having a standard BIOS,
but will not produce the same result on all systems
• Level 0 works with generic devices such as serial ports
and with specific I/O devices produced by known
manufacturers.
• Not all OS permit user programs to directly access
system hardware. Reserved for OS and device drivers
only

Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. 29

Vous aimerez peut-être aussi