Computers’ Basic Organization

Slides:



Advertisements
Similar presentations
CPU Review and Programming Models CT101 – Computing Systems.
Advertisements

Chapter 2.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Processor System Architecture
Computer Organization. This module surveys the physical resources of a computer system. –Basic components CPUMemoryBus I/O devices –CPU structure Registers.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 14 Inside.
Introduction to Computer Systems
1 Sec (2.1) Computer Architectures. 2 For temporary storage of information, the CPU contains cells, or registers, that are conceptually similar to main.
Data Manipulation Computer System consists of the following parts:
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
Computer Organization Computer Organization & Assembly Language: Module 2.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Computer Architecture and Organization Introduction.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Computer Organization - 1. INPUT PROCESS OUTPUT List different input devices Compare the use of voice recognition as opposed to the entry of data via.
CSCI 211 Intro Computer Organization –Consists of gates for logic And Or Not –Processor –Memory –I/O interface.
Computer Architecture And Organization UNIT-II General System Architecture.
Computer Science 101 Computer Systems Organization.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Structure & Architecture 7b - CPU & Buses.
Computer Studies/ICT SS2
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
Stored Program A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write,
Dale & Lewis Chapter 5 Computing components
Overview von Neumann Architecture Computer component Computer function
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
3.1.4 Hardware a. describe the function and purpose of the control unit, memory unit and ALU (arithmetic logic unit) as individual parts of a computer;
Assembly Language Basic job of a CPU: execute lots of instructions. Instructions are the primitive operations that the CPU may execute. Different CPUs.
Chapter 14 Inside the Computer - the von Neumann Architecture
CPU Lesson 2.
Computing Science Computer Structure: Lesson 1: Processor Structure
Computer Organization and Architecture Lecture 1 : Introduction
Systems Architecture Keywords Fetch Execute Cycle
Control Unit Lecture 6.
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor Systems Design I
Computer Design & Organization
Overview Introduction General Register Organization Stack Organization
Microprocessor and Assembly Language
Computer Architecture
MIPS Assembly.
Number Representations and Basic Processor Architecture
MIPS assembly.
CSCE Fall 2013 Prof. Jennifer L. Welch.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
ECEG-3202 Computer Architecture and Organization
Guest Lecturer TA: Shreyas Chand
Computer Architecture
CSCE Fall 2012 Prof. Jennifer L. Welch.
What is Computer Architecture?
Introduction to Microprocessor Programming
Instructions in Machine Language
What is Computer Architecture?
What is Computer Architecture?
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Computer Architecture
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
CPU Structure CPU must:
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
CSE378 Introduction to Machine Organization
Chapter 4 The Von Neumann Model
Presentation transcript:

Computers’ Basic Organization Von Neumann model MIPS programming model Registers Memory ALU Control Unit I/O Textbook: Appendix A .

C program to explain the Von Neumann model #include <stdio.h>   unsigned char array[1024]; unsigned char a,b,c; // temporary variables int i1,i2,j; // array indexes for operands and result char operation; // which operation to do int main() { printf( "Enter the operation sign +, -, /, * \n" ); scanf( "%c", &operation ); printf( "Enter the first operand's index in array \n" ); scanf( "%d", &i1 ); printf( "Enter the second operand's index in array \n" ); scanf( "%d", &i2 ); printf( "Enter the result's index in array \n" ); scanf( "%d", &j ); a = array[i1]; b = array[i2]; switch (operation) case '+': c = a+b; break; case '-': c = a-b; case '/': c = a/b; case '*': c = a*b; } array[j] = c; return 0; We have an array of bytes – this is similar to computer random access memory (RAM). It holds bytes’ values. It could be addressed – in our case for 1024 byte memory the addresses are from 0 to 1023. We can write into the array and read from it like with the memory. Variables – are similar to registers: They hold temporary values of operands after reading of the memory and hold the result before writing to memory. Operations are done with the variables (like with the registers). Input output results are kept in variables. Switch block decodes the operation like Control Unit and launches appropriate operation. The operation statements - similar to Arithmetic Logic Unit. ALU performs operations on the operands (registers) and writes the result back to variable (register). This simple C program by its behavior will help us to understand computer general organization. We should find here 5 main components of Von Neumann architecture: Memory Registers Control Unit ALU Input / Output Printf(), Scanf() – similar to Input / Output blocks. The input output is done through the registers (variables).

Von Neumann model Memory: keeps the program code and data. The other units periodically refer to memory to fetch (load) the data or program or to write (store) some information. Control Unit (CU): fetches instructions from memory decodes them to produce signals which control the other parts of the computer. transfers data between memory and ALU activates peripherals to perform input or output. Arithmetic and Logic Unit (ALU): performs operations such as addition, subtraction, multiplication of integers bit-wise AND, OR, NOT and other Boolean operations. Registers ( Accumulator): The data exchange between ALU, Memory and Input/Output is done through the Registers Registers are the memory which have the fastest access for CPU instructions. Input and Output devices are used when there is need to exchange information with the outside world. The Control Unit and ALU are included in single device called Central Processing Unit (CPU).

What is CPU and datapath ? Processor (CPU): the active part of the computer that does all the work (data manipulation and decision-making) Datapath: portion of the processor that contains hardware necessary to perform operations required by the processor (the brawn) Control: portion of the processor (also in hardware) that tells the datapath what needs to be done (the brain)

Harvard architecture physically separate storage and signal pathways for instructions and data. Allows high performance. Complex to implement 2 memories are needed Von Neumann bottleneck often limits the performance of the system But is simple to implement as only one memory is needed for both instructions and data

MIPS Programming Model A programming model is an abstract view of a processor that is appropriate for programming but omits details that are not needed for that task. It is the view of the machine a programmer uses when programming. Based on this model we can suppose the existence of several groups of MIPS instructions: Inter Register transfer instructions. Memory - register transfer instructions. Input / output instructions. Arithmetic or Logical instructions with registers.

Another MIPS programming model from the textbook MIPS contains: Integer arithmetic processor Floating point arithmetic processor Whole system’s Control Processor In this model from the textbook we can see several additional groups of MIPS instructions : Integer Multiplication Division instructions. Floating point arithmetic instructions. System Control instructions We have to learn all components of the model separately and all instructions and groups in details.

Assembly variables: Registers Assembly Operands are registers A register is a part of the processor that can hold a bit pattern operations can only be performed on these registers. Assembly – registers, Languages - local variables Local variables in C and Java can be unlimited and can have different length Registers in Assembly limited, same length. The Hardware should be simple. It’s impossible to create unlimited amount of unknown types of bit containers in the hardware. Benefit: Since registers are directly in hardware, they are very fast Registers are the memory which have the fastest access for CPU instructions. Drawback: Since registers are in hardware, there are a predetermined number of them Solution: MIPS code must be very carefully put together to efficiently use registers

General Purpose Registers A group of registers that are visible in MIPS assembly language are called general purpose registers. There are 32 general purpose registers. Why 32 ? More registers - less operations with memory . Each general purpose register holds a 32 bit pattern. Groups of 32 bits called a word in MIPS

Registers – Names and Numbers Each register can be referred to by number or name Registers are numbered from 0 to 31 Number references: $0, $1, $2, … $30, $31 By convention, each register also has a name to make it easier to code The names make your code more readable For example: $16 - $23  $s0 - $s7 (saved registers – more close to local variables in C) $8 - $15  $t0 - $t7 (temporary registers – more close to global variables in C) One of the general purpose registers, Register $0, is hard-wired to always contain the value 0x00000000 (all zero bits).

Registers have no type. In C (and most High Level Languages) variables declared first and given a type Example: int fahr, celsius; char a, b, c, d, e; Each variable can ONLY represent a value of the type it was declared as (cannot mix and match int and char variables). In Assembly Language, the registers have no type; operation or a program determines how register contents are treated

Register use convention