1 of 74

������������ �Introduction:

Computer Organization and Architecture is used to design computer systems.

Computer Architecture is considered to be those attributes of a system that are visible to the user like addressing techniques, instruction sets, and bits used for data, and have a direct impact on the logic execution of a program.

2 of 74

Functional units of a computer

3 of 74

Input Unit:

  • Computer accepts encoded information through input unit.
  • The standard input device is a keyboard. Whenever a key is pressed, keyboard controller sends the code to CPU/Memory.
  • Examples include Mouse, Joystick, Tracker ball, Light pen, Digitizer, Scanner etc

Arithmetic and logic unit:

  • ALU performs the arithmetic operations like addition, subtraction, multiplication, and division operations.
  • Additionally it performs logical operations like AND,OR,NOT operations.
  • After the calculations the results are stored in the memory.
  • Another feature of ALU is it has various operands. The operands are placed into the registers.The function of this operand is to store one word at a time.
  • They help in the faster retrieval of the data.

4 of 74

Memory Unit:

Memory unit stores the program instructions (Code), data and results of computations etc.

Memory unit is classified as:

  • Primary /Main Memory
  • Secondary /Auxiliary Memory
  • Cache memory

Primary /Main Memory :

  • Primary memory is the computer's main memory and stores data temporarily.
  • Primary memory, often referred to as main memory or internal memory, represents a category of computer memory situated directly on the central processing unit (CPU).
  • This memory module temporarily stores data and instructions during their processing. Notably, it operates as a swift and volatile form of memory, signifying that data is retained temporarily and is erased when the power supply is discontinued.

5 of 74

Classification of Primary Memory

We can broadly classify Primary Memory into two parts:

  • 1. Read-Only Memory or ROM
  • 2. Random Access Memory or RAM

6 of 74

Secondary /Auxiliary Memory:

  • Secondary memory is computer memory that is non-volatile, persistent and not immediately accessible by a computer or processor.
  • It allows users to store data and information that can be retrieved, transmitted, and used by apps and services quickly and easily.
  • Secondary storage is another name for secondary memory.
  • Memory in a computer refers to the physical components that are used to temporarily or permanently store programmes or data. It’s a collection of registers.
  • Secondary memory is the term for this form of memory.
  • Programs and data are stored in secondary memory.
  • Auxiliary memory is another name for it.
  • It differs from primary memory in that it is non-volatile and not directly accessible by the CPU.
  • Secondary storage devices, often known as external storage devices, have substantially more storage space and are less expensive than primary memory.

7 of 74

Examples of secondary storage:

  • Hard disk drives (HDD)
  • SSD (solid-state disk)
  • Internal flash memory (rare)
  • Optical discs (such as DVDs, CDs, Blu-ray discs, etc.)
  • Floppy disks
  • Memory cards
  • Disk packs
  • Magnetic tapes
  • Paper storage (such as punched cards, punched tapes, etc.)

8 of 74

Cache Memory:

  • Cache memory refers to high-speed memory. It is small but faster than RAM (the main memory).
  • The CPU can access the cache comparatively more quickly than its primary memory.
  • Thus, we use it to synchronize with a high-speed CPU and also to improve its overall performance.

Control unit:

  • The Control unit coordinates and controls the data flow in and out of CPU and also controls all the operations of ALU, memory registers and also input/output units.
  • It is also responsible for carrying out all the instructions stored in the program.
  • It decodes the fetched instruction, interprets it and sends control signals to input/output devices until the required operation is done properly by ALU and memory.

9 of 74

Output Unit

  • These actually are the counterparts of input unit.
  • Its basic function is to send the processed results to the outside world.
  • Examples:- Printer, speakers, monitor etc

10 of 74

Basic Operational Concepts

ADD LOCA, R0

This instruction is an addition operation.

The following are the steps to execute the instruction:

Step 1: Fetch the instruction from main memory into the processor

Step 2: Fetch the operand at location LOCA from main memory into the processor

Step 3: Add the memory operand (i.e. fetched contents of LOCA) to the contents of register

R0

Step 4: Store the result (sum) in R0.

11 of 74

Load LOCA

R1 Add R1,R0

The steps to execute the instructions can be enumerated as below:

Step 1: Fetch the instruction from main memory into the processor

Step 2: Fetch the operand at location LOCA from main memory in to the processor Register R1

Step 3: Add the content of Register R1 and the contents of register R0

Step 4: Store the result (sum) in R0.

12 of 74

Connections between processor and memory:

13 of 74

I/O Units

Input Devices

  • Input devices are the devices that are used to send signals to the computer for performing tasks. The receiver at the end is the CPU (Central Processing Unit), which works to send signals to the output devices. Some of the classifications of Input devices are:
  • Keyboard Devices
  • Pointing Devices
  • Composite Devices
  • Game Controller
  • Visual Devices
  • Audio Input Devices

14 of 74

Keyboard

  • The keyboard is the most frequent and widely used input device for entering data into a computer. Although there are some additional keys for performing other operations, the keyboard layout is similar to that of a typical typewriter.

15 of 74

Mouse

  • The most common pointing device is the mouse.
  • The mouse is used to move a little cursor across the screen while clicking and dragging.
  • The cursor will stop if you let go of the mouse.
  • The computer is dependent on you to move the mouse; it won’t move by itself. As a result, it’s an input device.
  • A mouse is an input device that lets you move the mouse on a flat surface to control the coordinates and movement of the on-screen cursor/pointer.The left mouse button can be used to select or move items, while the right mouse button when clicked displays extra menus.

16 of 74

Joystick

  • joystick is a pointing device that is used to move the cursor on a computer screen.
  • A spherical ball is attached to both the bottom and top ends of the stick.
  • In a socket, the lower spherical ball slides. You can move the joystick in all four directions.

17 of 74

Track Ball

  • Track Ball is an accessory for notebooks and laptops, which works on behalf of a mouse.
  • It has a similar structure to a mouse. Its structure is like a half-inserted ball and we use fingers for cursor movement.
  • Different shapes are used for this like balls, buttons, or squares.

18 of 74

Light Pen

  • A light pen is a type of pointing device that looks like a pen.
  • It can be used to select a menu item or to draw on the monitor screen.

19 of 74

Scanner

  • A scanner is an input device that functions similarly to a photocopier.
  • It’s employed when there’s information on paper that needs to be transferred to the computer’s hard disc for subsequent manipulation. 

20 of 74

Optical Mark Reader (OMR)

  • An Optical Mark Reader is a device that is generally used in educational institutions to check the answers to objective exams. It recognizes the marks present by pencil and pen.

Optical Character Reader (OCR)

  • OCR stands for optical character recognition, and it is a device that reads printed text.
  • OCR optically scans the text, character by character turns it into a machine-readable code, and saves it to the system memory.

21 of 74

Magnetic Ink Card Reader (MICR)

  • It is a device that is generally used in banks to deal with the cheques given to the bank by the customer. It helps in reading the magnetic ink present in the code number and cheque number. This process is very fast compared to any other process.

Bar Code Reader

  • A bar code reader is a device that reads data that is bar-coded (data that is represented by light and dark lines).Bar-coded data is commonly used to mark things, number books, and so on.
  • It could be a handheld scanner or part of a stationary scanner.
  • A bar code reader scans a bar code image, converts it to an alphanumeric value, and then sends it to the computer to which it is connected.

22 of 74

Web Camera

  • Because a web camera records a video image of the scene in front of it, a webcam is an input device.
  • It is either built inside the computer (for example, a laptop) or attached through a USB connection.
  • A webcam is a computer-connected tiny digital video camera. It’s also known as a web camera because it can take images and record video.
  • These cameras come with software that must be installed on the computer in order to broadcast video in real-time over the Internet.

23 of 74

Digitizer

Digitizer is a device that is used to convert analog signals to digital signals. it converts signals into numeric values. An example of a Digitizer is Graphic Tablet, which is used to convert graphics to binary data.

Microphone

The microphone works as an input device that receives input voice signals and also has the responsibility of converting it also to digital form. It is a very common device that is present in every device which is related to music.

24 of 74

Output Devices

  • Output Devices are the devices that show us the result after giving the input to a computer system.
  • Output can be of many different forms like image, graphic audio, video, etc. Some of the output devices are described below.

Monitor

  • Monitors, also known as Visual Display Units (VDUs), are a computer’s primary output device.
  • It creates images by arranging small dots, known as pixels, in a rectangular pattern.
  • The amount of pixels determines the image’s sharpness. �The two kinds of viewing screens used for monitors are described below.

25 of 74

Cathode-Ray Tube (CRT) Monitor: 

Pixels are minuscule visual elements that make up a CRT display.

The higher the image quality or resolution, the smaller the pixels.

Flat-Panel Display Monitor: 

In comparison to the CRT, a flat-panel display is a type of video display with less volume, weight, and power consumption.

26 of 74

Printer

  • Printers are output devices that allow you to print information on paper.

Speakers

  • Speakers are devices that produce sound after getting a command from a computer.
  • Nowadays, speakers come with wireless technology also like Bluetooth speakers.

Projector

  • Projectors are optical devices that have the work to show visuals on both types of screens, stationary and moving both.
  • It helps in displaying images on a big screen.
  • Projectors are generally used in theatres, auditoriums, etc.

Plotter

  • Plotter is a device that helps in making graphics or other images to give a real view.
  • A graphic card is mandatorily required to use these devices. These are the pen-like devices that help in generating exact designs on the computer.

27 of 74

Headphones

The Input and Output Devices of a Computer

USB Drive

  • USB Drive is one of the devices which perform both input and output operations as a USB Drive helps in receiving data from a device and sending it to other devices.

Modem

  • Modems are one of the important devices that helps in transmitting data using telephonic lines.

28 of 74

CD and DVD

  • CD and DVD are the most common device that helps in saving data from one computer in a particular format and send data to other devices which works as an input device to the computer.

Headset

  • The headset consists of a speaker and microphone where a speaker is an output device and a microphone works as an input device.

Facsimile

  • facsimile is a fax machine that consists of a scanner and printer, where the scanner works as an input device and the printer works as an output device.

29 of 74

Memory: Instruction: Instruction Formats

The most common fields are:

  • The operation field specifies the operation to be performed, like addition.
  • Address field which contains the location of the operand, i.e., register or memory location.
  • Mode field which specifies how operand is to be founded.

An instruction is of variable length depending upon the number of addresses it contains. Generally, CPU organization is of three types based on the number of address fields:

  • Single Accumulator organization
  • General register organization
  • Stack organization

30 of 74

Single Accumulator organization

  • All operations are performed with an implied accumulator register.
  • The instruction format in this type of computer uses one address field.
  • For example, the instruction that specifies an arithmetic addition is defined by an assembly language instruction as
  • ADD X. Where X is the address of the operand
  • The ADD instruction in this case results in the operation
  • AC ← AC + M[X].
  • AC is the accumulator register and M[X] symbolizes the memory word located at address X.

31 of 74

General register organization:

The instruction format in this type of computer needs three register address fields. Thus the instruction for an arithmetic addition may be written in an assembly language as

ADD R1, R2, R3

To denote the operation R1 ← R2 + R3. The number of address fields in the instruction can be reduced from three to two if the destination register is the same as one of the source registers. Thus the instruction

ADD R1, R2

Would denote the operation R1 ← R1 + R2.

Only register addresses for R1 and R2 need be specified in this instruction.

  • Computers with multiple processor registers use the move instruction with a mnemonic MOV to symbolize a transfer instruction. Thus the instruction

MOV R1, R2

Denotes the transfer R1 ← R2 (or R2 ← R1, depending on the particular computer). Thus transfer-type instructions need two address fields to specify the source and the destination.

32 of 74

Stack organization

  • Computers with stack organization would have PUSH and POP instructions which require an address field. Thus the instruction
  • PUSH X

33 of 74

Three-Address Instructions

The program in assembly language that evaluates

X = (A + B) (C + D)

ADD R1, A, B R1 ← M [A] + M [B]

ADD R2, C, D R2 ← M [C] + M [D]

MUL X, R1, R2 M [X] ← R1 R2

 

34 of 74

Two-AddressInstructions:

35 of 74

One-Address Instructions

36 of 74

Zero-Address Instructions

37 of 74

RISC Instructions

38 of 74

Addressing modes with numeric examples

Format of Instruction

  • The format of an instruction is depicted in a rectangular box symbolizing the bits of an instruction. Basic fields of an instruction format are given below:
  • 1. An operation code field that specifies the operation to be performed.
  • 2. An address field that designates the memory address or register.
  • 3. A mode field that specifies the way the operand of effective address is determined.

39 of 74

INSTRUCTION CYCLE AND PROGRAM COUNTER

40 of 74

41 of 74

42 of 74

43 of 74

44 of 74

45 of 74

46 of 74

47 of 74

48 of 74

49 of 74

50 of 74

51 of 74

52 of 74

53 of 74

54 of 74

55 of 74

56 of 74

57 of 74

PROGRAM CONTROL

58 of 74

Status bit conditions�conditional branch Instructions�Subroutine call and Return�Program Interrupt and types

59 of 74

60 of 74

61 of 74

62 of 74

63 of 74

64 of 74

65 of 74

66 of 74

67 of 74

68 of 74

69 of 74

70 of 74

71 of 74

72 of 74

73 of 74

74 of 74