CH02-HP Computer Abstractions and Technology
CH02-HP Computer Abstractions and Technology
• Application software
• Written in high-level language
• System software
• Compiler: translates HLL code to machine code
• Operating System: service code
• Handling input/output
• Managing memory and storage
• Scheduling tasks & sharing resources
• Hardware
• Processor, memory, I/O controllers
Levels of Program
Code
• High-level language
• Level of abstraction closer to
problem domain
• Provides for productivity and
portability
• Assembly language
• Textual representation of
instructions
• Hardware representation
• Binary digits (bits)
• Encoded instructions and data
Benefits of high-level
languages
Allow programmers to think in natural language,
often specific to their intended use
Fortran for scientific computations, Cobol for business,
LISP for symbol processing, etc
Increase productivity
Fewer lines of code required
Allow programs to be independent of computer on
which they are developed
portable; use of compilers
Under the cover
• Hardware performs same basic functions
across different types of computers
• input data
• output data
• process data
• store data
§1.3 Under the Covers
The BIG Picture
Components of a Computer
• Same components for
all kinds of computer (Desktop, server,
embedded)
• input
• output
• memory
• datapath
• control
Components of a Computer
• Input/output includes
• User-interface devices
• Display, keyboard, mouse
• Storage devices
• Hard disk, CD/DVD, flash
• Network adapters
• For communicating with other computers
Anatomy of a Computer
Output
device
Network
cable
Input Input
device device
Anatomy of a desktop PC
Inside the Processor (CPU)
Clock (cycles)
Data transfer
and computation
Update state
Relative frequency
CPI Example
Sequence 1: IC = 5 Sequence 2: IC = 6
Clock Cycles Clock Cycles
= 2×1 + 1×2 + 2×3 = 4×1 + 1×2 + 1×3
= 10 =9
Avg. CPI = 10/5 = 2.0 Avg. CPI = 9/6 = 1.5
Performance Summary
Performance depends on
Algorithm: affects IC, possibly CPI
Programming language: affects IC, CPI
Compiler: affects IC, CPI
Instruction set architecture: affects IC, CPI, T c
Computer Organization & Design:The HW/SW Interface 5th Edition
Computer Organization & Design:The HW/SW Interface 5th Edition
Computer Organization & Design:The HW/SW Interface 5th Edition
Reducing Power