Professional Documents
Culture Documents
Chapter1 Part2
Chapter1 Part2
• Computers in automobiles
Limited features with microprocessors/ micro controllers
Upgradation in all possible ways
Front and rear parking sensors
Camera and display system with a touch
Blind spot warning
Cruise control, Gesture and voice controls
Driver drowsiness
Autonomous driving
Introduction
• Cell phones
Bigger sized phones to small sizes
Dial pad to touch screen
Data rate improvements
Communication everywhere
Integration of all facilities
• Search engines
Learning starts here
Information are plenty finding the right one is a bigger task
Everyone relies on this
Servers
Modern form of olden day larger computers
Carry out large work loads (engineering application and scientific
computing)
Huge memory, greater computing facility
Can be accessed by many people via network
Classes of Computing Applications
Servers
Ranges in wide variety based on the capability and cost
Low range servers
More than a desktop computer with no screen and keyboard
Used for file storage, web browsing and small enterprise applications
Costs around thousand dollars
High end servers super computers
Has tens or thousands of processor with peak computing capacity
Large memory (terabytes 240 bytes/ 1012 bytes)
Used for high-end scientific and engineering computation
Weather forecasting, Oil exploration, large scale problems
Costs around hundred million dollars
Classes of Computing Applications
Embedded Computers
Largest class of computer used
Wide range of applications and performance
Application specific/ designed to run one or one set of related application
In practice, Users never realize the usage of embedded computers
Microprocessors used in car, music player
Computer in TV
Set of processors used in Cargo ship, Aeroplane
Features
Lower tolerance for failure (cargo ship and aeroplane)
Limitations on costs and power (music player)
Limited functionality
Full Range of Decimal and Binary Values
Hierarchy of Memory
• Memory speed influences the performance
• Programmers want memory to be fast, cheap and large
• Larger the size big problems can be solved
Assemblers
Converts assembly level language to machine level language/ binary
Converts symbolic notation to binary
Symbolic language Assembly language
Below your Program
Benefits of High Level Language
• Programmer can think in natural language (English, Algebraic expressions)
Easy for anyone understand
Processor
Control component that controls datapath, memory, I/O device
Datapath performs the arithmetic operation
Memory
Place where data/ programs are stored
Hardware
Memory
• Built from dynamic random access memory (DRAM) chip
• Unlike sequential access memories, DRAMs take same amount of access any part of
memory
• SRAM – static random access memory, less size but fast access, buffer to DRAM
Hardware
Volatile memory
Loses the data when power goes off
Hold data/ program while running
Primary memory or main memory
DRAM/ SRAM
Non-volatile memory
Does not lose data when power goes off
Secondary memory
Magnetic disks dominated and replaced by flash memories in mobile
devices
Slower and cheaper than SRAM
Performance
• Quite difficult to assess the performance of a computer
Throughput/ Bandwidth
• Measure of performance
• Amount of tasks completed per unit time
Case I: Does replacing a new processor with a faster version improves the
performance?
Case I: Does replacing a new processor with a faster version improves the
performance?
• From the execution time, it is known that computer A is faster than computer
B
• In terms of performance
• CPU Time/ CPU Execution Time time spent on computing the task (does
not include the waiting time for I/O data)
• System CPU Time CPU time spent by OS doing some task related to the
program
Measuring Performance
• Response Time/ Elapsed Time or Wall Clock Time total time to complete a
task
CPU Time
Elapsed Time
• It is difficult to differentiate the user CPU time and system CPU time
• Time for one clock period processor clock which runs at a constant rate
• Clock period The length of each clock cycle/ time for a complete clock
cycle (250 ps)
• By CPI, the processor using same instruction set architecture are compared
Measuring Performance
Consider Computer A has a clock of 250 ps and 2.0 as CPI for some program. If
another computer B with clock of 500 ps and 1.2 CPI for the same program.
Which is the computer that performs faster?. Assume both computer uses
same instruction set architecture.
Measuring Performance
Consider Computer A has a clock of 250 ps and 2.0 as CPI for some program. If
another computer B with clock of 500 ps and 1.2 CPI for the same program.
Which is the computer that performs faster?. Assume both computer uses
same instruction set architecture.
Which code sequence will execute faster? Which code sequence executes
more instructions? What is the CPI for each sequence?
Measuring Performance
No of instructions executed:
• Knowing the CPU execution time and clock rate, either CPI or instruction
count is sufficient to find the other
• No. of instructions and average CPI can be found using hardware counter
• Instead of clock per instructions (CPI), instructions per clock cycle (IPC) are
developed
• If processor executes 2 instructions per clock cycle, IPC = 2.0 and CPI = 0.5
• Turbo mode in Core i7 Clock rate increases by 10% until it becomes too
warm
Fallacies and Pitfalls
• Fallacies Mistakes Pitfalls Obstacles
Fallacy:
• Destination first
• Designers should use minimal number of registers for fast clock cycle
Operands of the Computer Hardware
Compiling a C assignment using MIPS registers
• Data from memory transferred to register before execution and register to memory
after execution
• To access data from memory for computation, instruction should specify the
address from which data is to be fetched
• To store 01234567
https://www.geeksforgeeks.org/little-and-big-endian-mystery/
Operands of the Computer Hardware
Memory Operands
• Address is calculated by the sum of the constant and content of the register
• C assignment statement:
• MIPS instruction:
lw $to, 32 ($s3) Index 8 requires offset value 32
add $s1, $s2, $t0
Operands of the Computer Hardware
Memory Operands
• Alignment restriction
• Data accessed from register are faster than from the memory
• Spilling registers most commonly used variables in registers and least used
variables in memory
• For good performance, sufficient registers are needed and compilers used
efficiently
Operands of the Computer Hardware
Constant or Immediate Operands
• Constants occur frequently in instructions
A=A+5
B = B – 10
C = A + B - 10
• Addition instruction
• Decimal representation
• The first and last field indicates opcode/ kind of instruction (0 and 32
add)
• R – type (register)
• I – type (immediate and data transfer instructions)
• J – type (jump)
Representing Instructions
I – type instructions
• $s3 19 rs field
• 32 address
Representing Instructions
• To avoid hardware complexity, instructions are kept similar across different
formats
R and I type has first three fields similar
• First field defines whether last half instructions as three separate fields (reg)
or as single field (immediate)
Representing Instructions
• Reg means 0 to 31
• Machine instructions
Representing Instructions
MIPS Machine Language
• sll instruction
• 9 shifted by 4 9 x 24 = 144
• AND operation can make set of bits to be zero with a bit pattern as 0
• Content of $t2
• Content of $t1
• Content of $t2
• Content of $t1
• Content of $t1
• Jump instruction
References