Sunday, February 25, 2018

Digital Design Part 3

4th→ assembler translates it to the machine language.


1.6 [20] <§1.6> Consider two different implementations of the same instruction
set architecture. Te instructions can be divided into four classes according to
their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz and CPIs of 1, 2, 3,
and 3, and P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2.
Given a program with a dynamic instruction count of 1.0E6 instructions divided
into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D,
which implementation is faster?
a. What is the global CPI for each implementation?
b. Find the clock cycles required in both cases.  



Class A
Class B
Class C
Class D
Clock Rate
P1
1
2
3
3
2.5*10^9
P2
2
2
2
2
3.0*10^9

CPI .1
.2
.5
.2

Which one is faster?
Cpu time = I * (CPI)Clock Rate
→ P1→ 1.04 *10^-3  | P2 → 6.67 * 10^-4  → p2 is faster
Global CPI = CPU TIME * clock rateNumber of instruction → p1 → 2.6 | p2 → 2.001
Number of Clock Cycle = Global CPI * Number of instruction
P1→ 2.6 * 10^6  | p2 → 2.001* 10^6
1.7 [15] <§1.6> Compilers can have a profound impact on the performance
of an application. Assume that for a program, compiler A results in a dynamic
instruction count of 1.0E9 and has an execution time of 1.1 s, while compiler B
results in a dynamic instruction count of 1.2E9 and an execution time of 1.5 s.
a. Find the average CPI for each program given that the processor has a clock cycle
time of 1 ns.
b. Assume the compiled programs run on two different processors. If the execution
times on the two processors are the same, how much faster is the clock of the
processor running compiler A’s code versus the clock of the processor running
compiler B’s code?  





Chapter 2


instruction set : The vocabulary of commands understood by a given architecture.
stored-program concept: The idea that instructions and data of many types can be stored in memory as numbers, leading to the stored-program computer.
word: The natural unit of access in a computer, usually a group of 32 bits; corresponds to the size of a register in the MIPS architecture.
Unlike programs in high-level languages, the operands of arithmetic instructions
are restricted; they must be from a limited number of special locations built directly
in hardware called registers.


data transfer: instruction A command that moves data between memory and registers. address A value used to delineate the location of a specific data
an element within a memory array.
In MIPS, words must start at addresses that are multiples of 4. This requirement
is called an alignment restriction, and many architectures have it.


Digital Design - Ch1 Part2


One way to think about execution time is that it equals the number of
instructions executed multiplied by the average time per instruction. Therefore, the
number of clock cycles required for a program can be written as :
Skipped
Q1)Describe the steps that transform a program written in a high-level
language such as C into a representation that is directly executed by a computer
Processor?
First,> C→ Words + Algebraic notation referred to bit or binary.
2nd →  every operation → compile to sets of operation in a compiler.

3nd → Translate to instruction in mnemonic (memory)

Digital Design - Chapter 1 part1

Supercomputers, which at the present consist of tens of thousands of
processors and many terabytes of memory, and cost tens to hundreds of millions
of dollars. Supercomputers are usually used for high-end scientific and engineering
calculations, such as weather forecasting, oil exploration, protein structure
determination, and other large-scale problems.  


Embedded computers are the most significant class of machines and span the broadest
range of applications and performance. Embedded computers include the
microprocessors found in your car, the computers in a television set, and the
networks of processors that control a modern airplane or cargo ship.  
PC is the personal mobile device (PMD).
Taking over from the traditional server is Cloud Computing, which relies upon
large data centers that are now known as Warehouse Scale Computers (WSCs).
Companies like Amazon and Google build these WSCs containing 100,000 servers
and then let companies rent portions of them so that they can provide software
services to PMDs without having to build WSCs of their own. Indeed, Sofware as
A Service (SaaS) deployed via the cloud is revolutionizing the software industry just
as PMDs and WSCs are revolutionizing the hardware industry. Today’s software
developers will often have a portion of their application that runs on the PMD and
a portion that runs in the Cloud.  
Use Abstraction to Simplify Design → Moore’s law
Make the Common Case Fast  → Sports car VS sports minivan!
Performance via Parallelism → We use multiple jet engines of a plane as our icon for
parallel performance
Performance via Pipelining → sequence of pipes
Performance via Prediction  → fortune-tellers crystal ball icon.
Hierarchy of Memories  → fast cache on top and rest on the bottom.
Dependability via Redundancy  → when hardware fail system will continue
systems software was sitting between the hardware and applications software.
There are many types of systems software, but two types of systems software
are central to every computer system today: an operating system and a compiler.
An operating system interfaces between a user’s program and the hardware
Moreover, provides a variety of services and supervisory functions. Among the most
important functions are:
■ Handling primary input and output operations
■ Allocating storage and memory
■ Providing for protected sharing of the computer among multiple applications
using it simultaneously.  
Compiler: A program that translates high-level language statements into assembly language statements. Binary
digit: Also called a bit. One of the two numbers in base 2 (0 or 1) that are the components
of information.
instruction: A command that computer hardware understands and obeys.
Assembler: A program that translates a symbolic version of instructions into the binary version.
assembly language: A symbolic representation of machine instructions.
machine language: A binary representation of machine instructions.
The five classic components of a computer are input, output, memory,
datapath, and control, with the last two sometimes combined and called
the processor. Figure 1.5 shows the standard organization of a computer.
Tis organization is independent of hardware technology: you can place
every piece of every computer, past and present, into one of these five
categories. To help you keep all this in perspective, the five components of
a computer are shown on the front page of each of the following chapters,
with the portion of interest to that chapter highlighted.  
Skipped --------
Performance :
response time:  Also called execution time. The total time required for the computer to complete a task,
including disk accesses, memory accesses, I/O activities, operating system, overhead, CPU execution, time, and so on.
Throughput: Also called bandwidth. Another measure of performance, it is the number of tasks
completed per unit time.  
1. Replacing the processor in a computer with a faster version?
2. Adding additional processors to a system that uses multiple processors for separate tasks—
for example, searching the web?
Decreasing response time almost always improves throughput. Hence, in case
1, both response time and throughput are improved. In case 2, no one task gets
work done faster, so only throughput increases.  
If, however, the demand for processing in the second case was almost
as large as the throughput, the system might force requests to queue up. In
this case, increasing the throughput could also improve response time, since
it would reduce the waiting time in the queue. Tus, in many real computer
systems, changing either execution time or throughput often affects the other.  
Ex:
CPU execution time: Also called CPU time. The actual time the CPU spends computing for a specific task.
user CPU time: The CPU time spent in a program itself.
system CPU time The CPU time spent in the operating system performing tasks on
behalf of the program.
§1.6, page 33: 1. a: both, b: latency, c: neither. 7 seconds.  



Digital Design Part 3

4th→ assembler translates it to the machine language. 1.6 [20] <§1.6> Consider two different implementations of the same instru...