1 of 50

COMPUTER ORGANIZATION AND ARCHITECTURE

Department of BCA

Loyola College of Arts and Science

Mettala

1

2 of 50

Unit-1

Introduction to Computer Organization and Architecture

3 of 50

Basic Computer Organization

  • The basic computer organization has three main components:

  • CPU

  • Memory subsystem

  • I/O subsystem

4 of 50

Generic computer Organization

5 of 50

System bus

The system bus has three buses,

  • Address bus

  • Data bus

  • Control bus

6 of 50

Address bus

The uppermost bus is the address bus. When the CPU reads data or instructions from or writes data to memory, it must specify the address of the memory location it wishes to access

7 of 50

Data bus

Data is transferred via the data bus. When CPU fetches data from memory it first outputs the memory address on to its address bus. Then memory outputs the data onto the data bus. Memory then reads and stores the data at the proper locations.

8 of 50

Control bus

Control bus carries the control signal. Control signal is the collection of individual control signals. These signals indicate whether data is to be read into or written out of theCPU.

9 of 50

Instruction cycle

The instruction cycle is the procedure a microprocessor goes through to process aninstruction.

It has three phases:

  • Fetch

  • Decode

  • Execute

10 of 50

Instruction cycle

  • First the processor fetchesor reads the instruction from memory.
  • Then it decodes the instruction determining which instruction

it has fetched.

  • Finally, it performs the operations necessary to executethe instruction.
  • It performs some operation internally, and supplies the address, data & control signals needed by memory & I/O devices to execute the instruction.

11 of 50

Control signals

The READ signal is a signal on the control bus which

the microprocessor asserts when it is ready to read data from memory or I/O device.

  • When READ signal is asserted the memory subsystem places the instruction code be fetched on to the computer system’s data bus. The microprocessor then inputs the data from the bus and stores its internal register.
  • READ signal causes the memory to read the data, the

WRITE

operation causes the memory to store the data

12 of 50

Timing diagrams

13 of 50

Memory read operation

  • In fig (a) the microprocessor places the address on to the bus at the beginning of a clock cycle, a 0/1 sequence of clock. One

address READ

clock cycle later, to allow for memory to decode the and access its data, the microprocessor asserts the control signal.

  • This causes the memory to place its data onto the system data bus. During this clock cycle, the microprocessor reads the data off the system bus and stores it in one of theregisters.

  • At the end of the clock cycle it removes the address from the address bus and deasserts the READ signal. Memory then removes the data from the data from the data bus completing the memory read operation

14 of 50

Memory write operation

  • In fig(b) the processor places the address and data onto the system bus during the first clock pulse.

WRITE control signal

  • The microprocessor then asserts the at

the end of the second clock cycle.

  • At the end of the second clock cycle the processor completes the memory write operation by removing the address and data from the system bus and deasserting the WRITE signal.

15 of 50

CPUOrganization

Central processing unit (CPU) is the electronic circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logical, control and input/ output (I/O) operations specified by the instructions.

16 of 50

CPUOrganization

  • In the computer all the all the major components are

connected with the help of the system bus.

  • Data bus is used to shuffle data between the various

components in acomputer system.

  • When the software wants to access some particular memory location or I/O device it places the corresponding address on the address bus.
  • The control bus is an eclectic collection of signals that control how the processor communicates with the rest of the system. The read and write control lines control the direction of data on the data bus.

17 of 50

CPU Organization

18 of 50

CPUOrganization

  • The register section, as its name implies, includes a set of

registers

and a bus or other communication mechanism.

  • The register in a processor’s instruction set architecture are found in the section of the CPU.

  • The system address and data buses interact with this section of CPU. The register section also contains other registers that are not directly accessible by the programmer.

19 of 50

CPUOrganization

first bus.

  • The fetch portion of the instruction cycle, the processor outputs the address of the instruction onto the address The processor has aregister ca led the ͞program counter͟.

the CPU reads

  • At the end of the instruction fetch, the

instruction code from the system data bus.

usually called

  • It stores this value in an internal register,

the

͞instruction register”.

20 of 50

CPUOrganization

  • The arithmetic / logic unit (or) ALU performs most arithmetic

and logic operations such as adding and ANDing values.

  • CPUcontrols the computer, the control unit controls the CPU.The control unit receives some data values from the register unit, which it used to generate the control signals.

  • The control unit also generates the signals for the system control bus such as READ,WRITE,IO/ signals

21 of 50

Memory Subsystem Organization

  • Memory is the group of circuits used to storedata.

  • Memory components have some number of memory locations, each word of which stores a binary value of some fixed length.

  • The number of locations and the size of each location vary from memory chip to memory chip, but they are fixed within individual chip.

22 of 50

Memory chips Internal organization

  • Memory is usua ly organized in the form of arrays, in which each cell is capable of storing one bit information.

  • Each row of cell constitutes a memory word, and all ce ls of a row are connected to a common column ca led word line, which is driven by the address decoder on the chip

23 of 50

Types of Memory

  • There are two types of memory chips,

  1. Read Only Memory (ROM)
  2. Random Access Memory (RAM)

24 of 50

ROMChips

  • Masked ROM(or) simply ROM

  • PROM(Programmed Read OnlyMemory)

  • EPROM(Electrica ly Programmed Read Only Memory)

  • EEPROM(Electrica ly Erasable PROM)

  • Flash Memory

25 of 50

ROMChips

Masked ROM

  • Amasked ROM or simply ROM is programmed with dataas

chip is fabricated.

  • The mask is used to create the chip and chip is designed with the required data hardwired in it.

26 of 50

  • PROM
  • Some ROM designs allow the data to be loaded by the user, thus providing programmable ROM (PROM).
    • Programmability is achieved by inserting a fuse at point Pin the above fig. Before it is programmed, the ŵeŵoƌy ĐoŶtaiŶs all Ϭ’s.
    • The useƌ iŶseƌt ϭ’s at the ƌeƋuiƌed loĐatioŶsďy

ďuƌŶiŶg

out the fuse at these locations using high current pulse.

  • The fuses

are ďlowŶ, PROM’s

in PROM cannot restoreonce they

ĐaŶ oŶly ďe pƌogƌaŵŵed oŶĐe.

27 of 50

ROMChips

  • EPROM
    • EPROMis the another ROM chip a lows the stored data to be erased and new data to be loaded. Such

reprogrammable ROM is usua ly ca led

an erasable an EPROM.

  • Programming

in EPROM

is done by charging of capacitors. The charged and uncharged capacitors

cause each word of memory to store the correct value.

  • The chip is erased by being placed under UV light, which causes the capacitor to leak their charge.

28 of 50

ROMChips

  • EEPRO M
  • A significant

disadvantage of the EPROM is the chip

is physica ly removed from the circuit for reprogramming and that entire contents are erased by the UVlight.

  • Another version of EPROM is EEPROM that can be both programmed and erased electrically, such chips ca led EEPROM,do not have to remove for erasure.
  • The only disadvantage of EEPROM is that different

voltages

are need for erasing, writing, reading and stored data

29 of 50

ROMChips

Flash Memory

Aspecial type of EEPROMis ca led a flash memory is electrically

erase data in blocks rather than individual locations.

It is well suited for the applications that writes blocks ofdata and can be used as a solid state hard disk. It is also used for data storage in digital computers.

30 of 50

Memory Subsystem Organization

  • RAM

ChRipAsM:

stands for Random access memory. This often

referred to as read/write memory. Unlike the ROM it initially contains nodata.

  • The data pins are bidirectional unlike in ROM.
  • AROM chip loses its data once power is removed so it is a volatile memory.
  • RAM chips are differentiated based on the data they maintain.

  • Dynamic RAM (DRAM)
  • Static RAM (SRAM)

31 of 50

Memory chips Internal organization

  • Dynamic RAM

  • DRAM chips are like leaky capacitors. Initially data is stored in the DRAM chip, charging its memory ce ls to their maximum values.
  • The charging slowly leaks out and would eventually go too low

to represent valid data.

  • Before this a refresher circuit reads the content of the DRAM and rewrites data to its original locations.
  • DRAM is used to construct the RAM in personal computers.

32 of 50

Memory chips Internal organization

  • Static RAM

  • Static RAM are more likely the register .Once the data is written to SRAM, its contents stay valid it does not haveto be refreshed.
  • Static RAM is faster than DRAM but it is also much more expensive. Cache memory in the personal computer is constructed from SRAM.

33 of 50

Memory chips Internal organization

  • Dynamic RAM

  • DRAM chips are like leaky capacitors. Initially data is stored in the DRAM chip, charging its memory ce ls to their maximum values.
  • The charging slowly leaks out and would eventually go too low

to represent valid data.

  • Before this a refresher circuit reads the content of the DRAM and rewrites data to its original locations.
  • DRAM is used to construct the RAM in personal computers.

34 of 50

Memory subsystem configuration

35 of 50

Multi byte organization

  • There are two commonly used organizationsfor multi byte data.

    • Big endian
    • Little endian

36 of 50

Multi byte organization

  • In BIG-ENDIAN systems the most significant byte of a multi- byte data item always has the lowest address, while the least significant byte has the highest address.

  • In LITTLE-ENDIAN systems, the least significant byte of a multi-byte data item always has the lowest address, while the most significant byte has the highest address.

37 of 50

I/O Subsystem Organization

The I/O subsystem is treated as an independent unit in the computer The CPUinitiates I/O commandsgenerica ly

  • Read, write, scan,etc.
  • This simplifies the CPU

38 of 50

Input Device

39 of 50

Input Device

  • The data from the input device goes to the tri-state buffers. When the value in the address and control buses are correct, the buffers are enabled and data passes on the data bus.

  • The CPU can then read this data. If the conditions are not right the logic block does not enable the buffers and do not place on the bus.

8-bit address and

  • The enable logic contains also generates

two control signals RDand I/O.

40 of 50

Output Device

make sure that one device writes data to the bus at anytime.

🠜 Since the output devices read from the bus, rather that

writes

data to it, they don’tneed the buffers.

🠜 The data can be made available to all output devices but the

devices only contains the correct address will read it in

  • The design of the interface circuitry for an output device such

different than for

input

as a computer monitor is somewhat the input device.

  • Tri-state buffers are replaced by a register.
  • The tri-state buffersare used in device interfaces to

41 of 50

Multi byte organization

  • There are two commonly used organizationsfor multi byte data.

    • Big endian
    • Little endian

42 of 50

Multi byte organization

  • In BIG-ENDIAN systems the most significant byte of a multi- byte data item always has the lowest address, while the least significant byte has the highest address.

  • In LITTLE-ENDIAN systems, the least significant byte of a multi-byte data item always has the lowest address, while the most significant byte has the highest address.

43 of 50

Output Device

make sure that one device writes data to the bus at anytime.

🠜 Since the output devices read from the bus, rather that

writes

data to it, they don’tneed the buffers.

🠜 The data can be made available to all output devices but the

devices only contains the correct address will read it in

  • The design of the interface circuitry for an output device such

different than for

input

as a computer monitor is somewhat the input device.

  • Tri-state buffers are replaced by a register.
  • The tri-state buffersare used in device interfaces to

44 of 50

Output Device

An output device: (a) with its interface and (b) the enable logic for the registers

45 of 50

Output Device

  • Some devices are used for both input and output. Personal computer and hard disk devices are fa ls into this category. Such a devices requires a combined interface that is essential two interfaces.
  • Abidirectional I/O device with its interface and enable load logic is shown in the Figure 1.7 below.

46 of 50

Output Device

Figure 1.7: Abidirectional I/O device with its interface and enable/loadlogic

47 of 50

ASimple Computer- Levels of PL

are divided

  • Computer programmminig languagegs categories.

into 3

  • High level language
  • Assembly level language
  • Machine level language

48 of 50

ASimple Computer- Levels of PL

  • High level languages are platform independent that is these programs can run on computers with different microprocessor and operating systems without modifications. Languages such as C++, Java and FORTRAN are high level languages.

  • Assembly languages are at much lower level of

abstraction. Each processor has its own assembly language

49 of 50

ASimple Computer- Levels of PL

  • The lowest

level of programming language

level languages. These languages values that cause the microprocessor

contain

to perform

is machin e the

operations. When microprocessor reads and executbesinaarny instruction it’s a machine language instruction. certain

50 of 50

ASimple Computer- Levels of PL

Figure 1.8: Levels ofprogramming languages