Introduction to progamming - BASIC COMPUTER ORGANIZATION AND DESIGN, Study notes of Computer Numerical Control

In this document topics covered which are BASIC COMPUTER ORGANIZATION AND DESIGN, INSTRUCTION CODE, OPERATION CODE, STORED PROGRAM ORGANIZATION, ACCUMULATOR , DIRECT ADDRESS.

Typology: Study notes

2010/2011

Uploaded on 09/03/2011

krithika
krithika 🇮🇳

4.4

(58)

96 documents

1 / 36

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BASIC COMPUTER
ORGANIZATION AND
DESIGN
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24

Partial preview of the text

Download Introduction to progamming - BASIC COMPUTER ORGANIZATION AND DESIGN and more Study notes Computer Numerical Control in PDF only on Docsity!

BASIC COMPUTER

ORGANIZATION AND

DESIGN

INSTRUCTION CODE

A computer instruction is a binary code that

specifies the sequence of microoperation for the

computer.

An instruction code is a group of bits that

instructs computer to perform specific operation.

An Instruction must therefore specify not only

the operation but also the registers or the

memory words where the operands are to be

found, as well as the register or memory word

where the result to be stored.

Memory words can be specified in Instruction

code.

STORED PROGRAM ORGANIZATION

The simplest way to organise a computer is to have one

processor register and an instruction code format for

two parts.

  • 1

st

part specifies operation. 4096*

  • And 2

nd

part specifies address/operand.

Example :

15 12 11 0

15 0

Binary operand

Instruction

(program)

Processor

Register

Opcode Address

Operands

(Data)

In previous figure show that the instruction are

stored in one section of memory and data is

another.

Let memory unit is 4096 word so we need 12 bits

because 2^12= 4096. specify the address.

If we store each instruction code in one 16 bit

word, there are four bits available for operation

code (opcode). Here 12 bits specify the address and

4 bits specify the operation code.

It uses the 12 bit address part of instruction to

read a 16bit operand from data portion of

memory.

15 14 12 11 0

instruction format

22 35

300

457

1350

Direct address Indirect Address

I opcode address

0 ADD 457

operand

AC

1 ADD 300

operand

AC

1350

COMPUTER REGISTER

Registers are temporary memory units that store

words. The registers are located in the processor,

instead of in RAM, so data can be accessed and

stored faster.

Example : DR  data register

AR Address register

Program Counter

A register in the control unit of the CPU that is used

to keep track of the address of the current or next

instruction. Typically, the program counter is

advanced to the next instruction, and then the

current instruction is executed.

BASIC COMPUTER REGISTER

CONNECTED TO A COMMON BUS

7 1 2 3 4 5 6

INSTRUCTION CYCLE

A sequence of instruction in the memory unit of

computer is called instruction cycle.

In the basic computer each instruction cycle

consist of the following phases

1.Fetch the instruction from memory

2.Decode the instruction

3.Read the effective address from memory if the

instruction has an indirect address.

4.Execute the instruction

Upon the completion of step 4 ,the control goes

back to step 1.

AND ADD LDA STA

BUN BSA ISZ

SC<- SC+

DR<-M[AR]

SC<- SC+

DR<-M[AR]

SC<- SC+

DR<-M[AR]

SC<- SC+

M[AR]<-AC

SC<- SC+

AC<- AC ^

DR

SC<- SC+

AC<- AC + DR

E<- C out

SC<- SC+

AC<-DR

SC<- SC+

PC<- AR

SC<- SC+

M[AR]<- PC

AR<- AR+

SC<- SC+

DR<-M[AR]

SC<- SC+

AR<- AR+

PC<- AR

SC<- SC+

DR<-DR+

SC<- SC+

M[AR]<- DR

If (DR=0) then

(PC<-PC+1)

Memory – reference instruction

Example of BSA instruction execution

0 BSA 135

Next Instruction

AC

1 BUN 135

AR=

PC=

20

136

Subroutine

0 BSA 135

Next Instruction

AC

1 BUN 135

135

21

20

PC=

Subroutine

21

MEMORY

ORGANIZATION

MEMORY HIERARCHY

Magnetic

tapes

Magnetic

disks

I/O Processor

Main

Memory

Cache

CPU^ memory

RAM [ Random Access Memory]

RAM is often associated with volatile types of

memory, where the information is lost after the

power is switched off.

Block diagram of RAM

ROM [Read Only Memory]

Readonly memory is a class of storage media used in

computers and other electronic devices. Because data

stored in ROM cannot be modified (at least not very

quickly or easily), it is mainly used to distribute

firmware (software that is very closely tied to specific

hardware, and unlikely to require frequent updates).