


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Below is the description of the hardware features of a desktop PC: Intel® 2nd Generation Core™ i3 (3.4GHz, L2 Cache Memory 3MB) System Memory: (RAM) 8GB DDR3 SDRAM Hard Drive: 1.5TB SATA (7200 rpm) Intel® HD Graphics 2000 (Video Memory Up to 4GB shared) Network Card: Built-in 10/100/1000Base-T Ethernet LAN Wireless Networking: Built-in 802.11b/g/n wireless LAN Recordable DVD Drive: 8x DVD+R DL; 8x DVD-R DL; 16x8x16 DVD+RW; 16x6x16 DVD-RW; 5x DVD-RAM; 40x24x40 CD-RW Digital Media Card Reader Available Expansion Bays: External: 1 (3.5"), 1 (5.25"); Internal: 1 (3.5") Available Expansion Slots: 1 PCI Express x1, 1 PCI Express x USB 2.0 Ports: 2 USB 3.0 (front); 4 USB 2.0 (rear) Wireless Keyboard with volume control Wireless optical mouse 20" widescreen flat panel monitor Operating System Windows 8
What does the processor do?
What is stored in main memory (RAM)?
What is stored on the hard disk?
What is the purpose of cache memory?
What terms relate to interconnection of internal PC components?
What terms relate to interconnection of external PC components?
What is a KB, MB, GB, Gigabit, MHz, GHz?
What is the role of the operating system?
Lecture 1 Page 1
High-level lang. (HLL) Assembly Lang. (AL) Machine Lang. (ML) (three-addr. RISC format) SUM = X + Y
PSW-process status word
PC, program counter
IR, instruction register
MAR, memory addr. reg
MDR, memory data reg
Address Bus
Data Bus Control Bus
System Bus Memory
CPU/Processor
(+,-,*, etc)
Add R1,R2,R
Control Unit
Register File
Load R2, X
Load R3, Y
Store R1, SUM
Program Area
Global Data
Heap
Stack
Unused
Operating System Area
(Addresses)
A Program's Address Space
Disk
Controller
Processing (/ Instruction / Machine ) Cycle of stored-program computer - repeat all day
Lecture 1 Page 2
Unconditional Branch j LABEL Always Branch to LABEL
bgt $4, $2, LABEL Branch to LABEL if $4 > $ (bge, blt, ble, beq, bne)
Conditional Branch
mul $4, $2, 100 $4 b$2 * 100 (32-bit product)
Arithmetic with Immediates addi $4, $2, 100 $4 b$2 + 100 (last operand must be an integer)
sub $4, $2, $3 $4 (^) b$2 - $
mul $10, $12, $8 $10 (^) b$12 * $8 (32-bit product)
Arithmetic Instruction add $4, $2, $3 $4 (^) b$2 + $ (reg. operands only)
Load Address la $5, mem $4 (^) bload address of mem
li $4, 100 $4 (^) b 100
Move move $4, $2 $4 b$
sw $4, Mem [Mem at address in $3 + 16]b $
lw $4, 16($3) $4b [Mem at address in $3 + 16]
sw $4, Mem Mem b$
Memory Access lw $4, Mem $4b [Mem] (Load and Store)
MIPS Register Transfer Language Description Assembly Language
Type of Instruction
Position in Sequence: 0 1 2 3 4 5 6 7 8
Fibonacci Sequence: 0 1 1 2 3 5 8 13 21
A high-level language program to calculate the nth^ fibonacci number would be:
temp2 = 0 temp3 = 1
for i = 2 to n do temp4 = temp2 + temp temp2 = temp temp3 = temp end for result = temp
temp temp
temp
i 2 3 4 5 6 7 8
Trace of Program (time )
$
$
$
$
variables
registers
A complete assembly language MIPS program to calculate the nth^ fibonacci number. .data n: .word 8 # variable in memory result: .word 0 # variable in memory
.text .globl main main: li $2, 0 # $2 holds temp li $3, 1 # $3 holds temp for_init: li $6, 2 # initialize i ($6) to 2 lw $5, n # load "n" into $ for_loop: bgt $6, $5, end_for add $4, $2, $3 # $4 holds temp move $2, $3 # shift temp3 to temp move $3, $4 # shift temp4 to temp addi $6, $6, 1 # increment i ($6) j for_loop end_for: sw $4, result # store the result to memory li $v0, 10 # system code for exit syscall # call the operating system
Lecture 1 Page 4