CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Size: px
Start display at page:

Download "CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions"

Transcription

1 CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How does the von Neumann Computer work? What is machine language? What is computer programming? 2 1

2 What did we do last time? Reviewed the full adder (the circuit which does binary number addition) Introduced some other circuits which are part of the CPU: the accumulator, the inverter Described the main memory as a location from which to read data into the adder, and to which data can be stored from the accumulator. Introduced the von Neumann architecture. 3 An Abstract View of CPU Circuits Unanswered Questions: How to specify whether to add or subtract. How to specify memory (RAM) addresses. 4 2

3 Stored Program Computer (Von Neumann Architecture) Figure 5.1 The von Neumann architecture 5 Control Processing Unit Central Processing Unit (CPU) Refers to the combination of the Arithmetic/Logic Unit and the Control Unit. 6 3

4 Arithmetic/Logic Unit The ALU performs basic arithmetic operations and logic operations. Examples: Arithmetic: addition, subtraction, multiplication Logical operations: AND, OR, NOT, XOR Most modern ALUs have a small amount of special storage units called registers The accumulator is the main register 7 Arithmetic/Logic Unit Recall how addition and subtraction happen (at the level of the CPU): Addition: take a value from memory send it to the adder add to the value in the accumulator Subtraction: take a value from memory, invert the bits, send to the adder, set carry-in to 1 add to the value in the accumulator 8 4

5 Arithmetic/Logic Unit The difference between addition and subtraction is slight; it can be controlled by sending a signal to the inverter and to the carry-in bit. This signal is like flipping a switch to tell the circuits to behave a certain way. But instead of flipping the switch, we could just use a binary input to an AND gate 9 Arithmetic/Logic Unit Given that: instructions are carried out by sending data through circuits circuits can be controlled by flipping switches. A binary code can be used to control which operation the CPU will do at a given time. 10 5

6 Control Unit The control unit coordinates the flow of operations and data in the computer. coordinates the ALU and memory Instruction register (IR) Contains the binary code indicating which instruction is being executed. Program counter (PC) Contains the address (in memory) of the next instruction to be executed. 11 Flow of Information Bus A set of wires that connect all major components of the computer. Figure 5.2 Data flow through a von Neumann architecture 12 6

7 The Computer Clock The computer has oscillator generates an endless rapid stream of off/on pulses (0,1,0,1 ). Each change from 0 to 1 is called a clock cycle. cycles per second is one measure of CPU speed measured in Hertz (MHz, GHz) cycles per second The clock cycle is used to coordinate the tasks of the various circuits. 13 The Fetch-Execute Cycle Figure 5.3 The Fetch-Execute Cycle 14 7

8 Fetch Execute Cycle The previous diagram shows how it takes 4 steps to execute each instruction. Is cycles per second a valid measure of CPU performance? 15 Stored Program Computer (Von Neumann Architecture) Data and instructions to manipulate the data are logically the same (binary code) and can be stored in the same place (RAM). The machine language of a particular computer is the set of binary coded instructions built into its hardware. 16 8

9 Machine Language Characteristics of machine language: Every processor type has its own set of specific machine instructions. The relationship between the processor type and the instructions it can carry out is completely integrated. Each machine-language instruction does only one very low-level task. 17 Machine Language Example A Virtual Computer is a hypothetical machine designed to contain the important features of a real computer that we want to illustrate. Our examples will use the Pep/7 virtual computer designed by Stanley Warford that has 32 machinelanguage instructions. Note: different than the Super Simple CPU

10 Instruction Format The machine language of a particular computer is the set of binary coded instructions built into its hardware. This machine language has a 3-byte instruction format. Figure 7.2 The Pep/7 instruction format 19 Instruction Format Operation Code Specifies which instruction is to be carried out. Register Specifier Specifies which register is to be used. Addressing-mode Specifier How to interpret the operand part of the instruction. 00 for immediate (value given in operand) 01 for direct (memory address given in operand) 20 10

11 Some Sample Instructions Figure 7.3 Subset of Pep/7 instructions 21 Sample Instructions What does this instruction mean? Load immediate value 7 into the accumulator 22 11

12 Sample Instructions What does this instruction mean? Load value from address 31 into the accumulator 23 Sample Instructions What does this instruction mean? Store value from accumulator into address

13 Sample Instructions What does this instruction mean? Add value from address 522 into the accumulator 25 Sample Instructions What does this instruction mean? Read a character of input into address

14 Sample Instructions What does this instruction mean? Send a character from address 10 to output 27 Computer Programming The CPU does some low-level tasks, and each one is specified as a machine-language instruction. How do we get the CPU to do stuff for us? Computer programming is the process of analyzing a problem, designing a solution, and expressing that solution as a series of computer instructions. Computer programs must be written in the language the computer understands

15 Programming Strategy Divide and Conquer! Break up a large problem into smaller units and solve each smaller problem. Applies the concept of abstraction. The divide-and-conquer approach can be applied over and over again until each subtask is manageable. 29 Machine Language Example Hello, world! program The classic first computer program is called Hello World It prints the words Hello, world to the screen. How to write it in Machine Language for the Pep/7? Specify explicit tasks in unambiguous language. Divide and conquer: Keep refining these tasks until we arrive at a concrete set of instructions which map to machine language instructions

16 Writing a Computer Program Write "Hello, World!" Is this concrete yet? Write "Hello, World!" Write "H" Write "e" Write "l" Write "l" Write "o" Is this concrete yet? 31 Writing a Computer Program Write "H" Write 0x48 Is this concrete yet? Write "e" Write 0x65... Write "o" Write 0x6F 32 16

17 Writing a Computer Program 33 Machine Language Machine language is the set of binary coded instructions built into the hardware of a particular computer, and used directly by ALU/Control Unit. why are the instructions binary encoded? how does this encoding relate to the hardware? 34 17

18 Review: Machine Language Operation Code Specifies which instruction is to be carried out. Register Specifier Specifies which register is to be used. Addressing-mode Specifier How to interpret the operand part of the instruction. 00 for immediate (value given in operand) 01 for direct (memory address given in operand) 35 What the Computer Can Do Modern computer processors can do the following types of basic tasks (CPU instructions): Add, subtract, multiply, divide, increment, decrement Logical AND, OR, XOR, NOT, and NEG operations Load data in from RAM, store data out to RAM Load data from/ send data to input/output Compare register contents for equal to Zero, Less than Zero, Negative Jump to another instruction (by address) Note: by data, we mean one word (e.g. 32 bits) 36 18

19 The JUMP Instruction Recall that the von Neumann computer stores data and instructions in the same RAM. The Program Counter holds the address of the next instruction to be executed. Usually, to find the next instruction, the PrC increments the stored address. The JUMP instruction changes the address stored in the Program Counter programmatically. Conditionally: jump if accumulator equals 0 Conditionally: jump if accumulator is less than 0 Unconditionally: just jump 37 The JUMP Instruction The JUMP instruction enables decision making and repetition inside the CPU. One could argue that JUMP is what makes a computer really programmable. Examples (with some abstraction): If a value is less than 0, then jump to instruction 7 If the quotient is 0, then end the program

20 Lab 09 Learning Objective To deepen your understanding of the central processor unit, the fetch-execute cycle, and the stored program concept. In addition, you will use pseudo code to express an algorithm, and translate the algorithm into machine-language instructions which the CPU can execute

21 Super Simple CPU Input: 1 word (16 bits) Output 1 word (16 bits) Registers: Program Counter Accumulator Temp Instruction Register RAM: 16 words (16 bits each) 41 SSCPU Machine Language Note: the Super Simple CPU has a different instruction format and opcode list than the Pep/7 CPU. Why? What are the implications of this? SSCPU Instruction Format: Each instruction is 16 bits First 4 bits specify the operation code (opcode) Last 12 bits specify either a RAM address, or an immediate value (a.k.a. a literal number) 42 21

22 SSCPU Machine Language Some example instructions: 1111: stop the program 0001: add operand to accumulator 0010: subtract operand from accumulator 0011: load memory cell into accumulator 0101: store accumulator into memory cell 0110: input value into accumulator 0111: output value from accumulator 43 Lab Exercise You will use a simple, simulated CPU to: observe the CPU s fetch-execute cycle in action become acquainted with machine language programming and instructions experiment with programming in a machine language You will write a pseudo code algorithm, and a machine language program to do addition of 2 numeric inputs

23 Pseudo code Pseudo code is a way of expressing algorithms that uses a mixture of English phrases and indention to make the steps in the solution explicit. There are no grammar rules in pseudocode. Pseudocode is not case sensitive. Analogy: pseudo code is like an outline for writing a paper -- it contains all of the main ideas, but is not tied to the structure of grammar, etc. 45 Algorithms Algorithm A set of unambiguous instructions for solving a problem or subproblem in a finite amount of time, and using a finite amount of data. For a given set of inputs, the algorithm will always produce the same outputs

24 Following an Algorithm Grandpa Ron s Chocolate Kahlua Mudslides Ingredient List: ½ cup vodka ½ cup Kahlua ½ cup Bailey s Irish Cream ¼ cup Hershey s chocolate syrup 1 blender full of ice Process: Fill blender with ice. Pours other ingredients onto ice. Blend until smooth consistency. Pour into glasses and enjoy. 47 Following an Algorithm Algorithm for preparing Chocolate Mudslides: If not all ingredients are present Go to store and buy missing ingredients Fill blender with ice Pour other ingredients into the blender While (not smooth) Turn on blender Wait 10 seconds Turn off blender Test consistency with wooden spoon Pour into glasses and serve 48 24

25 Partial Summary Even the modern computer is still a moronic number-crunching, data moving device. Algorithms describe the explicit steps the computer must follow to solve a problem. Pseudocode is a tool to help us express an algorithm, but it is not understood by the computer. Why would anyone want to write a program in machine language? 49 Assembly Language Assembly language A language that uses mnemonic codes to represent machine-language instructions Mnemonic code examples: LOADA means load value into accumulator ADDA means add value into accumulator STOREA means store value from accumulator 50 25

26 The Assembly Process Assembler A program that reads each of the instructions in mnemonic form and translates it into the machine-language equivalent. 51 Pep/7 Assembly Language Mode specifier: i = immediate, d = direct (memory) 52 26

27 Pep/7 Assembly Language An assembly language can have pseudo operations which do not map directly to the underlying machine language operations. 53 Example: Pseudo Code Program Reading and adding three numbers Set sum to 0 Read num1 Add num1 to sum Read num2 Add num2 to sum Read num3 Add num3 to sum Write sum 54 27

28 Example: Assembly Program 55 Partial Summary Assembly language: much easier to write/read than machine language! Why not just use assembly language instead of machine language? Who wrote the assembler program, and what language was it written in? Why not just write programs in pseudo code, and have a program translate that into machine language instructions? 56 28

29 Take-Away Points Von Neumann Architecture Arithmetic/Logic Unit Control Unit Machine Language Divide and Conquer strategy 57 Student To Dos Readings: Reed ch 7, pp Reed ch 6 Homework on course schedule. Wednesday: Meet in CS teaching lab

CS101 Lecture 28: Programming Languages. John Magee 1 August 2013 Some material copyright Jones and Bartlett. Overview/Questions

CS101 Lecture 28: Programming Languages. John Magee 1 August 2013 Some material copyright Jones and Bartlett. Overview/Questions CS101 Lecture 28: Programming Languages John Magee 1 August 2013 Some material copyright Jones and Bartlett 1 Overview/Questions Programming in machine language code is a lot more fun than wiring up the

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

Introduction to Design of a Tiny Computer

Introduction to Design of a Tiny Computer Introduction to Design of a Tiny Computer (Background of LAB#4) Objective In this lab, we will build a tiny computer in Verilog. The execution results will be displayed in the HEX[3:0] of your board. Unlike

More information

Notes on Assembly Language

Notes on Assembly Language Notes on Assembly Language Brief introduction to assembly programming The main components of a computer that take part in the execution of a program written in assembly code are the following: A set of

More information

6.5 TOY Machine Architecture

6.5 TOY Machine Architecture The TOY Machine 6.5 TOY Machine Architecture Combinational circuits. ALU. Sequential circuits. Memory. Machine architecture. Wire components together to make computer. TOY machine. 256 16-bit words of

More information

Advanced Computer Architecture-CS501

Advanced Computer Architecture-CS501 Lecture Handouts Computer Architecture Lecture No. 12 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 4 Computer Systems Design and Architecture 4.1, 4.2, 4.3 Summary 7) The design process

More information

SIT102 Introduction to Programming

SIT102 Introduction to Programming SIT102 Introduction to Programming After working through this session you should: Understand the relationships between operating systems, their user interfaces, and programs; Understand the difference

More information

Experiment 5. Arithmetic Logic Unit (ALU)

Experiment 5. Arithmetic Logic Unit (ALU) Experiment 5 Arithmetic Logic Unit (ALU) Objectives: To implement and test the circuits which constitute the arithmetic logic circuit (ALU). Background Information: The basic blocks of a computer are central

More information

BLOCK DIAGRAM OF A COMPUTER SYSTEM

BLOCK DIAGRAM OF A COMPUTER SYSTEM BLOCK DIAGRAM OF A COMPUTER SYSTEM Analysis of CPU In order to work, a computer needs some sort of "brain" or "calculator". At the core of every computer is a device roughly the size of a large postage

More information

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

More information

ORG ; ZERO. Introduction To Computing

ORG ; ZERO. Introduction To Computing Dec 0 Hex 0 Bin 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

Machine Architecture. ITNP23: Foundations of Information Technology Una Benlic 4B69

Machine Architecture. ITNP23: Foundations of Information Technology Una Benlic 4B69 Machine Architecture ITNP23: Foundations of Information Technology Una Benlic 4B69 ube@cs.stir.ac.uk Basic Machine Architecture In these lectures we aim to: Understand the basic architecture of a simple

More information

(Refer Slide Time: 00:01:16 min)

(Refer Slide Time: 00:01:16 min) Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

More information

registers: general-purpose and special-purpose. general purpose serve as temporary holding places for data being manipulated by the CPU.

registers: general-purpose and special-purpose. general purpose serve as temporary holding places for data being manipulated by the CPU. 2.1 Operations are performed via the CPU, central processing unit. It consists of two parts: the arithmetic/logic unit or ALU(performs data manipulation) and the control unit or CU(coordinates the machine

More information

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT FORM 5 COMPUTER STUDIES Chapter 14: The Central Processing Unit March, 01 14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT Still remember what CPU is? If not, take a look of the following: CPU is a device

More information

Question 2. Question 3. 0 out of 1 points. The basic commands that a computer performs are, and performance of arithmetic and logical operations.

Question 2. Question 3. 0 out of 1 points. The basic commands that a computer performs are, and performance of arithmetic and logical operations. The basic commands that a computer performs are, and performance of arithmetic and logical operations. input, file Question 2 input, output, storage output, folder storage, directory Main memory is called.

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

CS101 Lecture 05: Logic Gates and Binary Addition

CS101 Lecture 05: Logic Gates and Binary Addition CS101 Lecture 05: Logic Gates and Binary Addition Logic Gates Binary Number Addition Some images copyright Jones and Bartlett Thanks to Charles Petzold for some diagrams and ideas Aaron Stevens (azs@bu.edu)

More information

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the

More information

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are

More information

Chapter 2. Anatomy of a computer

Chapter 2. Anatomy of a computer Christian Jacob Chapter 2 Anatomy of a computer 2.1 Layers of Virtual Machines 2.2 The Register Machine Model 2.2.1 Main components of a von Neumann computer architecture 2.2.2 CPU and RAM 2.2.3 Execution

More information

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the

More information

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2 Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of

More information

Why study the Alpha (assembly)?

Why study the Alpha (assembly)? Why study the Alpha (assembly)? The Alpha architecture is the first 64-bit load/store RISC (as opposed to CISC) architecture designed to enhance computer performance by improving clock speeding, multiple

More information

CHAPTER 7: The CPU and Memory

CHAPTER 7: The CPU and Memory CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

More information

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

More information

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Von Neumann Model University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic

More information

Unit 5 Central Processing Unit (CPU)

Unit 5 Central Processing Unit (CPU) Unit 5 Central Processing Unit (CPU) Introduction Part of the computer that performs the bulk of data-processing operations is called the central processing unit (CPU). It consists of 3 major parts: Register

More information

Computer Organization I. Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture

Computer Organization I. Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture Computer Organization I Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture Overview General Architecture of von Neumann Machine - Memory Subsystem; - Arithmetic Logic Unit; - Control

More information

Lecture 1: Introduction to Microcomputers

Lecture 1: Introduction to Microcomputers Lecture 1: Introduction to Microcomputers Today s Topics What is a microcomputers? Why do we study microcomputers? Two basic types of microcomputer architectures Internal components of a microcomputers

More information

Data paths for MIPS instructions

Data paths for MIPS instructions You are familiar with how MIPS programs step from one instruction to the next, and how branches can occur conditionally or unconditionally. We next examine the machine level representation of how MIPS

More information

Lecture 3 A Very Simple Processor. Memory MPU I/O. Memory. Memory, registers and ALU. Memory

Lecture 3 A Very Simple Processor. Memory MPU I/O. Memory. Memory, registers and ALU. Memory Lecture 3 A Very Simple Processor Based on von Neumann model Instruction for the microprocessor (stored program) and the data for computation are both stored in memory Microprocessing Unit (MPU) contains:

More information

CPU Organisation and Operation

CPU Organisation and Operation CPU Organisation and Operation The Fetch-Execute Cycle The operation of the CPU 1 is usually described in terms of the Fetch-Execute cycle. 2 Fetch-Execute Cycle Fetch the Instruction Increment the Program

More information

Central Processing Unit (CPU)

Central Processing Unit (CPU) Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. Part 5: Processors Our goal: understand basics of processors and CPU understand the architecture of MARIE, a model computer a close look at the instruction

More information

William Stallings Computer Organization and Architecture

William Stallings Computer Organization and Architecture William Stallings Computer Organization and Architecture Chapter 12 CPU Structure and Function Rev. 3.3 (2009-10) by Enrico Nardelli 12-1 CPU Functions CPU must: Fetch instructions Decode instructions

More information

Basic Computer Organization and Design

Basic Computer Organization and Design Ted Borys - CSI 404 3/2/2004 Page 5-1 Section 5 Basic Computer Organization and Design Mano s Basic Computer Memory unit with 4096 16-bit words Registers: AR, PC, DR, AC, IR, TR, OUTR, INPR, SC Flip-flops:

More information

The CPU, Instruction Fetch & Execute

The CPU, Instruction Fetch & Execute Lecture 2 The CPU, Instruction Fetch & Execute In Lecture 1 we learnt that the separation of data from control helped simplify the definition and design of sequential circuits, particularly when there

More information

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue Introduction to Microcontrollers 1 Introduction It is hard to imagine the present world of electronic devices without the microprocessor. Cash register, scales, ovens, washing machine, alarm clock, thermostats,

More information

Processing Unit. Backing Store

Processing Unit. Backing Store SYSTEM UNIT Basic Computer Structure Input Unit Central Processing Unit Main Memory Output Unit Backing Store The Central Processing Unit (CPU) is the unit in the computer which operates the whole computer

More information

Introduction to Computer System

Introduction to Computer System Representation of Basic Information Introduction to Computer System The basic functional units of computer are made of electronics circuit and it works with electrical signal. We provide input to the computer

More information

ELG3331: Lab 3 Digital Logic Circuits

ELG3331: Lab 3 Digital Logic Circuits ELG3331: Lab 3 Digital Logic Circuits What does Digital Means? Digital describes any system based on discontinuous data or events. Typically digital is computer data or electronic sampling of an analog

More information

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level System: User s View System Components: High Level View Input Output 1 System: Motherboard Level 2 Components: Interconnection I/O MEMORY 3 4 Organization Registers ALU CU 5 6 1 Input/Output I/O MEMORY

More information

Pope Paul VI College Information and Communication Technology

Pope Paul VI College Information and Communication Technology Pope Paul VI College Information and Communication Technology CPU - Central processing unit (CPU) is the brain of a computer which and instructions of a computer program. - It executes computer instructions

More information

Intro to Microprocessors and Microcomputers

Intro to Microprocessors and Microcomputers Intro to Microprocessors and Microcomputers Content Microprocessor, microcontrollers and microcomputers Communication within microcomputers Registers Process architecture CPU Data and program storage Negative

More information

Chapter 1 Basic Concepts

Chapter 1 Basic Concepts Chapter 1 Basic Concepts 1.1 Welcome to Assembly Language 1 1.1.1 Good Questions to Ask 2 1.1.2 Assembly language Applications 5 1.1.3 Section Review 6 1.2 Virtual Machine Concept 7 1.2.1 History of PC

More information

Today s lecture is all about the System Unit, the Motherboard, and the Central Processing Unit, Oh My!

Today s lecture is all about the System Unit, the Motherboard, and the Central Processing Unit, Oh My! Today s lecture is all about the System Unit, the Motherboard, and the Central Processing Unit, Oh My! Or what s happening inside the computer? Computer Architecture CPU Input Memory a.k.a. RAM Output

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 9 - Register Transfer and Microoperations Microoperations Digital systems are modular in nature, with modules containing registers, decoders, arithmetic

More information

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software

More information

COMPUTER ARCHITECTURE IMPORTANT QUESTIONS FOR PRACTICE

COMPUTER ARCHITECTURE IMPORTANT QUESTIONS FOR PRACTICE COMPUTER ARCHITECTURE IMPORTANT QUESTIONS FOR PRACTICE 1. How many bits wide memory address have to be if the computer had 16 MB of memory? (use the smallest value possible) 2. A digital computer has a

More information

CPU Organization and Assembly Language

CPU Organization and Assembly Language COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:

More information

1 Classical Universal Computer 3

1 Classical Universal Computer 3 Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit

More information

SESSION 8 MARIE. ISE218 Fundamentals of Information Technology. Robert F. Kelly,

SESSION 8 MARIE. ISE218 Fundamentals of Information Technology. Robert F. Kelly, SESSION 8 MARIE Reading: Sections 4.8-4.11 ISE218 Fundamentals of Information Technology 2 Objectives Better understand the operations of a computer by examining a very simple processor that includes many

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

LMMS: An 8-bit Microcode Simulation of the Little Man Computer

LMMS: An 8-bit Microcode Simulation of the Little Man Computer LMMS: An 8-bit Microcode Simulation of the Little Man Computer Thad Crews Western Kentucky University 1 Big Red Way (270) 745-4643 thad.crewsii@wku.edu Abstract The Little Man Computer (LMC) is a simplified

More information

Assembly Language: Overview! Jennifer Rexford!

Assembly Language: Overview! Jennifer Rexford! Assembly Language: Overview! Jennifer Rexford! 1 Goals of this Lecture! Help you learn:! The basics of computer architecture! The relationship between C and assembly language! IA-32 assembly language,

More information

Simulation & Synthesis Using VHDL

Simulation & Synthesis Using VHDL Floating Point Multipliers: Simulation & Synthesis Using VHDL By: Raj Kumar Singh - B.E. (Hons.) Electrical & Electronics Shivananda Reddy - B.E. (Hons.) Electrical & Electronics BITS, PILANI Outline Introduction

More information

Introduction to digital computers

Introduction to digital computers Introduction to digital computers The Von Neumann Architecture Von Neumann Architecture Designing Computers All computers more or less based on the same basic design, the Von Neumann Architecture! 2 The

More information

Recap & Perspective. Sequential Logic Circuits & Architecture Alternatives. Register Operation. Building a Register. Timing Diagrams.

Recap & Perspective. Sequential Logic Circuits & Architecture Alternatives. Register Operation. Building a Register. Timing Diagrams. Sequential Logic Circuits & Architecture Alternatives Recap & Perspective COMP 251 Computer Organization and Architecture Fall 2009 So Far: ALU Implementation Next: Register Implementation Register Operation

More information

Microprocessor Overview

Microprocessor Overview EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 16th January 2002 CLR Part I Microprocessor Overview Central processing units (CPU s) for early computers, were originally

More information

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110

More information

Building a computer. Electronic Numerical Integrator and Computer (ENIAC)

Building a computer. Electronic Numerical Integrator and Computer (ENIAC) Building a computer Electronic Numerical Integrator and Computer (ENIAC) CSCI 255: Introduc/on to Embedded Systems Keith Vertanen Copyright 2011 Layers of abstrac

More information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three subsystems of a computer. Describe the

More information

Tutorial. Introduction to 8085 Architecture and Programming

Tutorial. Introduction to 8085 Architecture and Programming Tutorial On Introduction to 8085 Architecture and Programming Contents 1. Internal architecture of 8085 microprocessor 2. 8085 system bus 3. 8085 pin description. 4. 8085 functional description. 5. Programming

More information

Department of Computer and Mathematical Sciences. Assigment 4: Introduction to MARIE

Department of Computer and Mathematical Sciences. Assigment 4: Introduction to MARIE Department of Computer and Mathematical Sciences CS 3401 Assembly Language 4 Assigment 4: Introduction to MARIE Objectives: The main objective of this lab is to get you familiarized with MARIE a simple

More information

Design of the ALU Adder, Logic, and the Control Unit

Design of the ALU Adder, Logic, and the Control Unit Design of the ALU Adder, Logic, and the Control Unit This lecture will finish our look at the CPU and ALU of the computer. Remember: 1. The ALU performs the arithmetic and logic operations. 2. The control

More information

Computer Organization. A quick review

Computer Organization. A quick review Computer Organization A quick review Data Representation and Number Conversion Data Representation O Binary System O 2 digits 0, 1 O Trinary/Ternary System O 3 digits 0, 1, 2 O Decimal System O 10 digits

More information

Computer Organization. and Instruction Execution. August 22

Computer Organization. and Instruction Execution. August 22 Computer Organization and Instruction Execution August 22 CSC201 Section 002 Fall, 2000 The Main Parts of a Computer CSC201 Section Copyright 2000, Douglas Reeves 2 I/O and Storage Devices (lots of devices,

More information

#5. Show and the AND function can be constructed from two NAND gates.

#5. Show and the AND function can be constructed from two NAND gates. Study Questions for Digital Logic, Processors and Caches G22.0201 Fall 2009 ANSWERS Digital Logic Read: Sections 3.1 3.3 in the textbook. Handwritten digital lecture notes on the course web page. Study

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

Transferring Data Among Registers. Serial Data Register Transfer

Transferring Data Among Registers. Serial Data Register Transfer Transferring Data Among Registers Point-to-Point Transfer Serial Transfer: Shift Registers Parallel Transfer Control (Strobing Signal) Clocking Multiplexing Bus Transfer Avoids Using Multiplexers Destination

More information

1 Computer Architecture Question Bank Part A Questions

1 Computer Architecture Question Bank Part A Questions 1 Computer Architecture Part A Questions 1. What is stored program concept? 2. Differentiate memory write and I/O write. 3. What are the various methods of accessing data from memory? 4. Define memory

More information

1.10 (a) Effects of logic gates AND, OR, NOT on binary signals in a processor

1.10 (a) Effects of logic gates AND, OR, NOT on binary signals in a processor Chapter 1.10 Logic Gates 1.10 (a) Effects of logic gates AND, OR, NOT on binary signals in a processor Microprocessors are the central hardware that runs computers. There are several components that make

More information

CENTRAL P ROCESSING UNIT

CENTRAL P ROCESSING UNIT CENTRAL P ROCESSING UNIT...... he CPU (central processing unit) is the heart of every embedded system and every personal computer. It comprises the ALU (arithmetic logic unit), responsible for the number

More information

Administrative Issues

Administrative Issues CSC 3210 Computer Organization and Programming Introduction and Overview Dr. Anu Bourgeois (modified by Yuan Long) Administrative Issues Required Prerequisites CSc 2010 Intro to CSc CSc 2310 Java Programming

More information

Output depends on sequence of previous inputs Sequence of previous this is history History is a state that captures how you got here

Output depends on sequence of previous inputs Sequence of previous this is history History is a state that captures how you got here Sequential Logic Output depends on sequence of previous inputs Sequence of previous this is history History is a state that captures how you got here " E.g., 35 cents vending = cents + cents + cents +

More information

Computers Are Your Future Eleventh Edition

Computers Are Your Future Eleventh Edition Computers Are Your Future Eleventh Edition Chapter 2: Inside the System Unit Copyright 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 All rights reserved. No part of this publication may be

More information

Unit Objectives. Data is Stored in Types. Component 4: Introduction to Information and Computer Science

Unit Objectives. Data is Stored in Types. Component 4: Introduction to Information and Computer Science Component 4: Introduction to Information and Computer Science Unit 3: Computer Hardware & Architecture Lecture 3 This material was developed by Oregon Health & Science University, funded by the Department

More information

Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See P&H 2.4 (signed), 2.5, 2.6, C.6, and Appendix C.

Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See P&H 2.4 (signed), 2.5, 2.6, C.6, and Appendix C. Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See P&H 2.4 (signed), 2.5, 2.6, C.6, and Appendix C.6 Goals for today Binary (Arithmetic) Operations One-bit and four-bit

More information

SUMMER 13 EXAMINATION

SUMMER 13 EXAMINATION Page 1 of 28 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written

More information

MACHINE ARCHITECTURE & LANGUAGE

MACHINE ARCHITECTURE & LANGUAGE in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based

More information

In this chapter we are concerned with basic architecture and the. different operations related to explain the proper functioning of the

In this chapter we are concerned with basic architecture and the. different operations related to explain the proper functioning of the CHAPTER I CONTENTS: 1.1 INTRODUCTION 1.2 STORED PROGRAM ORGANIZATION 1.3 INDIRECT ADDRESS 1.4 COMPUTER REGISTERS 1.5 COMMON BUS SYSTEM SUMMARY SELF ASSESSMENT OBJECTIVE: In this chapter we are concerned

More information

Computing Systems. The Processor: Datapath and Control. The performance of a machine depends on 3 key factors:

Computing Systems. The Processor: Datapath and Control. The performance of a machine depends on 3 key factors: Computing Systems The Processor: Datapath and Control claudio.talarico@mail.ewu.edu 1 Introduction The performance of a machine depends on 3 key factors: compiler and ISA instruction count clock cycle

More information

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization David Sullins, Dr. Hardy Pottinger, Dr. Daryl Beetner University of Missouri Rolla Session I.

More information

DATA MANIPULATION. COMS W1001 Introduction to Information Science. Boyi Xie

DATA MANIPULATION. COMS W1001 Introduction to Information Science. Boyi Xie 1 DATA MANIPULATION COMS W1001 Introduction to Information Science Boyi Xie 2 Today s Topics Computer Architecture Machine Language Program Execution Arithmetic/Logic Instructions Communication with Other

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

İSTANBUL AYDIN UNIVERSITY

İSTANBUL AYDIN UNIVERSITY İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER

More information

An Overview of Stack Architecture and the PSC 1000 Microprocessor

An Overview of Stack Architecture and the PSC 1000 Microprocessor An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which

More information

Decimal Number (base 10) Binary Number (base 2)

Decimal Number (base 10) Binary Number (base 2) LECTURE 5. BINARY COUNTER Before starting with counters there is some vital information that needs to be understood. The most important is the fact that since the outputs of a digital chip can only be

More information

CDA 3103 Computer Organization

CDA 3103 Computer Organization CDA 3103 Computer Organization Exam 2 (Oct. 27th, 2014) Name: USF ID: Exam Rules Problem Points Score 1 10 2 10 3 15 4 7 5 8 6 10 Total 60 Use the back of the exam paper as necessary. But indicate clearly

More information

Computer Architecture

Computer Architecture Computer Architecture Having studied numbers, combinational and sequential logic, and assembly language programming, we begin the study of the overall computer system. The term computer architecture is

More information

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

A s we saw in Chapter 4, a CPU contains three main sections: the register section, 6 CPU Design A s we saw in Chapter 4, a CPU contains three main sections: the register section, the arithmetic/logic unit (ALU), and the control unit. These sections work together to perform the sequences

More information

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 4 MARIE: An Introduction to a Simple Computer CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 145 4.1.1 CPU Basics and Organization 145 4.1.2 The Bus 147 4.1.3 Clocks 151 4.1.4 The Input/Output Subsystem 153 4.1.5 Memory Organization

More information

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design Learning Outcomes Simple CPU Operation and Buses Dr Eddie Edwards eddie.edwards@imperial.ac.uk At the end of this lecture you will Understand how a CPU might be put together Be able to name the basic components

More information

Ch 5: Designing a Single Cycle Datapath

Ch 5: Designing a Single Cycle Datapath Ch 5: Designing a Single Cycle path Computer Systems Architecture CS 365 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Control Memory path Input Output Today s

More information

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers Chapter 01: Introduction Lesson 02 Evolution of Computers Part 2 First generation Computers Objective Understand how electronic computers evolved during the first generation of computers First Generation

More information

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 4 MARIE: An Introduction to a Simple Computer CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 195 4.2 CPU Basics and Organization 195 4.2.1 The Registers 196 4.2.2 The ALU 197 4.2.3 The Control Unit 197 4.3 The Bus 197 4.4 Clocks

More information

Processing Unit Design

Processing Unit Design &CHAPTER 5 Processing Unit Design In previous chapters, we studied the history of computer systems and the fundamental issues related to memory locations, addressing modes, assembly language, and computer

More information

CoE 353: Advanced Computer Architecture

CoE 353: Advanced Computer Architecture CoE 353: Advanced Computer Architecture 1997 John D. Carpinelli, All Rights Reserved 1 Course Outline Module # Topics 1 RTL, Micro-operations 2 Basic Computer 3 CPU Design 4 Microprogramming 1997 John

More information

Unit 8 : Microprocessor Architecture

Unit 8 : Microprocessor Architecture Unit 8 : Microprocessor Architecture Lesson 1 : Microcomputer Structure 1.1. Learning Objectives On completion of this lesson you will be able to : draw the block diagram of a simple computer understand

More information