Intro To Comp Architecture

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1. Distinguish between computer structure and function.

COMPUTER STRUCTURE COMPUTER FUNCTION


It is a mechanical component such It is an action such as processing
as a hard disk data
It falls under computer organization It falls under computer architecture
It defines the overall look of the It defines how the computer system
system works in a practical environment

2. Mapping techniques of cache memory


a) Direct Mapping
The simplest method which converts each main memory block into a
single potential cache line. Each memory block should be mapped
directly to a particular cache line. When a new block needs to be loaded
and a line was previously occupied by a memory block, the old block is
deleted. Index field and tag field are the two sections that make up an
address space. The tag field is kept in the cache, while the remainder is
kept in main memory.
b) Associative Mapping
In this kind of mapping, the content and addresses of the memory word
are stored in the associative memory. Any block may enter the cache in
any line. In other words, the word id bits are utilized to determine which
word in the block is required, but the tag takes the place of all the other
bits. This makes it possible to insert any word into the cache memory at
any location. It is regarded as the quickest and most adaptable mapping
form. The index bits in associative mapping are zero.

c) Set-associative Mapping
This type of mapping is an improved version of direct mapping that does
not have the downsides of direct mapping. This is accomplished by
stating that we will create sets of many lines in the cache rather than
having a single line that a block can map to exactly. The lines of a
particular set can then be mapped to any block in memory. Each word in
the cache can have two or more words in the main memory at the same
index address thanks to set-associative mapping.

3. Pipeline hazards
a) Structural hazards
Structural hazards arise due to hardware resource conflict amongst the
instructions in the pipeline. A resource here could be the Memory, a
Register in GPR or ALU. This resource conflict is said to occur when
more than one instruction in the pipe is requiring access to the same
resource in the same clock cycle. This is a situation that the hardware
cannot handle all possible combinations in an overlapped pipelined
execution.
b) Data hazards
 Instruction depends on result of prior instruction still in the pipeline.
Data hazards are classified into three categories based on the order of
READ or WRITE operation on the register and these include RAW (read
after write), WAR (write after read) and WAW (write after write).
c) Control hazards
Caused by delay between the fetching of instructions and decisions about
changes in control flow of program or instructions execution (branches and
jumps).

4. Four basic parts that make up an assembly language program:-


a) label
b) mnemonic
c) operand
d) comment

5. Two locality principles observed with respect to user programs and how
they are exploited in computer design : -
a) Temporal locality
Temporal locality is the tendency of programs to use data items over and
again during the course of their execution. This is the founding principle
behind caches and gives a clear guide to an appropriate data-management
heuristic. If a program uses an instruction or data variable, it is probably
a good idea to keep that instruction or data item nearby in case the
program wants it again in the near future. Items accessed recently are
likely to be accessed again soon for example instructions in a loop and
induction variables.
b) Spatial locality
Items near those accessed recently are likely to be accessed soon for
example sequential instruction access and array data. To exploit spatial
locality, a cache uses larger blocks to hold several consecutive words.
The advantage of a block size greater than one is that when a miss occurs
and the word is fetched into the cache, the adjacent words in the block
are also fetched.

You might also like