You are on page 1of 7

Unit 2

Saqs

1:-Assembly languages are low-level languages for programming computers, microprocessors,


microcontrollers, and other IC. They implement a symbolic representation of the numeric machine
Codes and other constants needed to program a particular CPU architecture. This representation is
usually defined by the hardware manufacturer, and is based on abbreviations that help the programmer
to remember individual instructions, registers. An assembler directive is a statement to give direction to
the assembler to perform task of the assembly process.

It control the organization if the program and provide necessary information to the assembler to
understand the assembly language programs to generate necessary machine codes. They indicate how
an operand or a section of the program is to be processed by the assembler.

An assembler supports directives to define data, to organise segments to control procedure, to define
macros. It consists of two types of statements: instructions and directives. The instructions are
translated to the machine code by the assembler whereas directives are not translated to the machine
codes.

Assembler Directives of the 8086 Microprocessor

(a) The DB directive

(b) The DW directive

(c) The DD directive

(d) The STRUCT (or STRUC) and ENDS directives (counted as one)

(e)The EQU Directive


(f)The COMMENT directive

(g)ASSUME

(h) EXTERN

(i) GLOBAL

(j) SEGMENT

(k)OFFSET

(l) PROC

(m)GROUP

(n) INCLUDE

2:-

Algorithm –

Move the input data in register AX

Move the data 0000 in CX and FFFF in BX

Add 0002 to the contents of BX

Increment the content of CX by 1


Subtract the contents of AX and BX

If Zero Flag(ZF) is not set go to step 3 else go to step 7

Store the data from CX to offset 600

Stop

Program –

OFFSET MNEMONICS COMMENT

0400 MOV AX, [500] AX <- [500]

0404 MOV CX, 0000 CX <- 0000

0407 MOV BX, FFFF BX <- FFFF

040A ADD BX, 02 BX = BX + 02 040E INC CX C = C + 1 040F SUB AX, BX AX = AX


– BX 0411 JNZ 040A JUMP to 040A if ZF = 0 0413 MOV [600], CX [600] <- CX 0417
HLT Stop

Explanation –

M0V AX, [500] is used to move the data from offset 500 to register AX

MOV CX 0000 is used to move 0000 to register CX

MOV BX FFFF is used to move FFFF to register BX

ADD BX, 02 is used to add BX and 02

INC CX is used to increment the content of CX by 1

SUB AX, BX is used to subtract contents of AX with BX

JNZ 040A is used to jump to address 040A if zero flag(ZF) is 0

MOV [600], CX is used to store the contents of CX to offset 600

HLT is used end the program

3ANSWER :--A pipelined system typically requires more resources (circuit elements, processing units,
computer memory, etc.) than one that executes one batch at a time, because its stages cannot share
those resources, and because buffering and additional synchronization logic may be needed between
the elements.

Pipelining is sometimes compared to a manufacturing assembly line in which different parts of a product
are being assembled at the same time although ultimately there may be some parts that have to be
assembled before others are. Even if there is some sequential dependency, the overall process can take
advantage of those operations that can proceed concurrently.

Computer processor pipelining is sometimes divided into an instruction pipeline and an arithmetic
pipeline. The instruction pipeline represents the stages in which an instruction is moved through the
processor, including its being fetched, perhaps buffered, and then executed. The arithmetic pipeline
represents the parts of an arithmetic operation that can be broken down and overlapped as they are
performed.

Unit 3
1ANSWER :-Main Memory

Main memory is where programs and data are kept when the processor is actively using them. When
programs and data become active, they are copied from secondary memory into main memory where the
processor can interact with them. A copy remains in secondary memory.

Main memory is intimately connected to the processor, so moving instructions and data into and out of the
processor is very fast.

Main memory is sometimes called RAM. RAM stands for Random Access Memory. "Random" means that the
memory cells can be accessed in any order. However, properly speaking, "RAM" means the type of silicon
chip used to implement main memory.

When people say that a computer has "512 megabytes of RAM" they are talking about how big its main
memory is. One megabyte of memory is enough to hold approximately one million (106) characters of a word
processing document. (There will be more about bytes and megabytes later on in these notes.)

Nothing permanent is kept in main memory. Sometimes data are placed in main memory for just a few
seconds, only as long as they are needed.
2ANSWER :-

A:-

B:-
Q:-What is Memory Hierarchy?

The memory in a computer can be divided into five hierarchies based on the speed as well as use. The
processor can move from one level to another based on its requirements. The five hierarchies in the memory
are registers, cache, main memory, magnetic discs, and magnetic tapes. The first three hierarchies are
volatile memories which mean when there is no power, and then automatically they lose their stored data.
Whereas the last two hierarchies are not volatile which means they store the data permanently.

Memory Hierarchy in Computer Architecture

The memory hierarchy design in a computer system mainly includes different storage devices. Most of the
computers were inbuilt with extra storage to run more powerfully beyond the main memory capacity. The
following memory hierarchy diagram is a hierarchical pyramid for computer memory. The designing of the
memory hierarchy is divided into two types such as primary (Internal) memory and secondary (External)
memory.

You might also like