note7 - CSCI 120 Introduction to Computation Inside a...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSCI 120 Introduction to Computation Inside a computer (draft) Saad Mneimneh Visiting Professor Hunter College of CUNY 1 The Computer Architecture Lets recall from Lecture 3 the architecture of a modern computer, illustrated again below. instruction and data memory ALU ALU fetch instr. control Central Processing Unit CPU I/O input/output devices registers Figure 1: Computer architecture In the figure above, we can identify five main components of a computer architecture: 1.1 Main memory As explained before, the main memory contains both data and programs. This is basically the idea behind a stored-program computer. The program is treated as data, and is stored in memory. But how can the program be treated as data? To answer this question, we need to ask a second question: What is a program? Luckily, we know the answer to this second question. Since a program is simply the encoding of an algorithm, it consists of a sequence of computational steps that perform a certain task. Therefore, in order to store a program as data, we need to store this sequence of steps. Each step, called an instruction, will have a unique representation in bits such that the control unit of the computer will recognize it when fetching it from memory. The set of all these instructions is called the instruction set of the computer (see Section 1.5). 1.2 CPU (Central Processing Unit) The Central Processing Unit (CPU) is the brain of the computer. The CPU found in todays computers (e.g. Pentium and Celeron by Intel, and Athlon and Sempron by AMD) is a small flat chip (approximately two inches by two inches) that is connected by pins into a socket mounted on the computers main circuit board, which is the body of the computer and usually referred to as the motherboard . The motherboard has a bus (collection of wires) that connected the CPU to other components such as memory and input/output controllers (keyboard, mouse, disks, monitor, etc...). 1.2.1 Control unit and registers The control unit contains the necessary circuitry to coordinate the machines activity. Instructions are fetched from memory for execution by the control unit. The control unit decodes the instruction and determines what needs to be done. If for instance an arithmetic operation is to be performed, the control unit forwards the desired operands to the arithmetic and logic unit ALU. Together, they form the Central Processing Unit, CPU. For temporary storage of infor- mation, the control unit uses a number of registers [modern form of Babbage s piles of disks :)]. These registers are used as place holders for the operands and the results of arithmetic or logical operations performed by the ALU (see below). A special register, called the program counter , holds the value of the memory location from which the next instruction needs to be fetch. Therefore, when the control unit fetches an instruction, it also increments the value in the program counter appropriately to point to the next memory location from which...
View Full Document

This note was uploaded on 03/27/2010 for the course CSCI 120 taught by Professor Saadmneimneh during the Spring '09 term at CUNY Hunter.

Page1 / 6

note7 - CSCI 120 Introduction to Computation Inside a...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online