Cheat Sheet
Cheat Sheet
Definition of a Computer
Varied versions of
definition of a computer
A computer is a fast
electronic calculating
machine that accepts
digitized input information,
processes it according to a
list of internally stored
instructions, and produces
the resulting output
information
From Computer
Organization by Hamacher,
Vranesicand Zaky
A computeris a
programmable machine
that receives input, stores
and manipulates data, and
provides output in a useful
format.
From wikipedia
A computeris an
electronic device that
manipulates information or
"data." It has the ability to
store, retrieve, and
processdata.
From GCF online class
Computer Basics
Computer Hardware vs.
Computer Organization
Computer hardware
Electronic circuits and
equipment that constitutes
the computer
Computer Organization
Operational units and their
interconnections that
realize/implement the
architectural specifications
Classes of Computers
Desktop computers
General purpose, variety
of software
Subject to
cost/performance tradeof
Server computers
Network based
High capacity,
performance, reliability
Range from small servers
to building sized
Embedded computers
Hidden as components of
systems
Stringent
power/performance/cost
constraints
Below Your Programs
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
Five Classic Components of
a Computer
Input device
A mechanism through
which the computer is fed
information
Keyboard, mouse,
Output device
A mechanism that coveys
the result of a computation
Screen, printer,
Memory
The storage area in which
programs and data are kept
DRAM (dynamic random
access memory), SRAM
(static random access
memory), cache, hard
drives, flash memory,
Details to be discussed in
CS365
Main memory and
secondary memory
Volatile memory vs.
nonvolatile memory
Datapath
Control
A Safe Place for Data
Volatile main memory
Loses instructions and
data when power of
Non-volatile secondary
memory
Magnetic disk
Flash memory
Optical disk (CDROM, DVD)
The Processor
Also called CPU (Central
Processing Unit)
Comprises two main
components
Datapath
The component of the
processors that performs
arithmetic operations
Control
The component of the
processor that commands
the datapath, memory, and
I/O devices according to the
instructions of the program
Communicating with other
Computers
Computer Networks
An important component
of todays computer
a collection of computers
and devices interconnected
by communications
channels that facilitate
communications among
users and allows users to
share resource
Local area networks, wide
area networks,
Details to be discussed in
CS380
Advantages of networked
computers
Information exchange
Abstractions
Abstraction helps us deal
with complexity
Hide lower-level detail
Instruction set architecture
(ISA)
The hardware/software
interface
Application binary
interface
The ISA plus system
software interface
Implementation
The details underlying and
interface
Languages of Hardware
To speak to electronic
hardware
Electrical signals
Signals: high/low
Switches: on/of
Fundamentally, what
language does a machine
understand?
Binary digit
Instruction: a command
that computer hardware
understands and obeys
Can be represented in
binary format
Interface of hardware and
software
Instruction set architecture
From High-Level Language
to the Language of
Hardware
High-level programming
languages
Java, C++,
Language of the hardware
Instructions and data
represented in binary
format
Translation process
Compiler: a program that
translates a program
written in high-level
language into low-level
language (i.e. assembly
language) statements
Assembler: a program that
translates symbolic version
of instructions (in assembly
language) into binary
version
From High-Level Language
to Machine Language
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
Assembly Language vs.
Machine Language
Assembly language
A symbolic representation
of machine instructions
Machine language
A binary representation of
machine instructions
Instruction
A command that computer
hardware understands and
obeys
Information Representation
Binary computers
Bits
Bytes
Megabyte(MB), Gigabyte
(GB), terabyte (TB),
Petabyte,
Words, double words,
Integer and floating point
numbers
Character sets
ASCII, Unicode,
Lecture 2 will discuss data
representation in more
details
Lecture 3a: MIPS
Architecture
Instruction Set Architecture
Instruction Set Architecture
(ISA)
Also called architecture
An abstract interface
between hardware and
lowest-level software
Including the design of
instructions and machine
organization
Machine organization:
including registers, memory
organization,
A Typical CPU Structure
The CPU consists of a data
section (also known as the
datapath) containing
registers and an ALU, and a
control section.
Machine Instructions
In general a machine
Instruction has the
following fields (parts):
An opcode field, which
specifies the operation to
be performed.
One or more of address
fields, each one is either a
memory address or a
register address (register's
number).
A mode field, which
specifies the way the
address field is to be
interpreted.
ofset(Rs) 111
Shift Left Logical sll Rd, Rt,
sa 111
Shift Left Logical Variable
sllv Rd, Rt, Rs 1 1 1
S e t on Less Than sit Rd,
Rt, Rs 111
Set on Less Than
Immediate slti Rt, Rs, Imm
111
Set on Less Than
Immediate Unsigned sltiu
Rt, Rs, Imm 111
Set on Less Than Unsigned
situ Rd, Rt, Rs 111
Shift Right Arithmetic sra
Rd, Rt, sa 111
Shift Right Arithmetic
Variable srav Rd, Rt, Rs 111
Shift Right Logical sri Rd,
Rt, sa 111
Shift Right Logical Variable
srlv Rd, Rt, Rs 111
Subtract sub Rd, Rs, Rt 111
Subtract Unsigned subu Rd,
Rs, Rt 111
Store Word sw Rt, ofset(Rs)
111
Store Word Left swl Rt,
ofset(Rs) 111
Store Word Right swr Rt,
ofset(Rs) 111
System Call syscall 111
Exclusive OR xor Rd, Rs, Rt
111
Exclusive OR Immediate
xori Rt, Rs, Imm 111
MIPS MACRO
INSTRUCTIONS
Absolute Value abs Rd, Rs
3/3
Branch if Equal to Zero
beqz Rs, Label 1/1
Branch if Greater Than or
Equal bge Rs, Rt, Label 2
Branch if Greater Than bgt
Rs, Rt, Label 212
Branch if Greater Than
Unsigned bgtu Rs, Rt, Label
Branch if Less Than or
Equal ble Rs, Rt, Label 2/2
Branch if Less Than or
Equal Unsigned bleu Rs, Rt,
Label 2/2
Branch if Less Than bit Rs,
Rt, Label 2/2
Branch if Less Than
Unsigned bltu Rs, Rt, Label
2/2
B ranch if Not Equal to Zero
bnez Rs, Label 111
Branch Unconditional b
Label 111
D ivide div Rd, Rs, Rt 4/41
D ivide Unsigned divu Rd,
Rs, Rt 4/41
Load Address la Rd, Label
2/2
Load Immediate Ii Rd, value
2/2
Move move Rd, Rs 111
Multiply mul Rd, Rs, Rt 2/33
Multiply (with overflow
exception) mulo Rd, Rs, Rt
= $a2 - 1
j
while
while
done:
SYS CALLS
# jump to
$a1 =