Black Boxes and Abstraction or A quick run through how computers work

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

The CPU The Central Presentation Unit What is the CPU?
Computer Architecture and the Fetch-Execute Cycle
PIPELINE AND VECTOR PROCESSING
Arithmetic Logic Unit (ALU)
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
The Logic Machine We looked at programming at the high level and at the low level. The question now is: How can a physical computer be built to run a program?
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Memory - Registers Instruction Sets
Stored Program Concept: The Hardware View
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
The central processing unit and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
The Computer Processor
SUPERSCALAR EXECUTION. two-way superscalar The DLW-2 has two ALUs, so it’s able to execute two arithmetic instructions in parallel (hence the term two-way.
CPU Fetch/Execute Cycle
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
The Central Processing Unit (CPU) and the Machine Cycle.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Fetch-execute cycle.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
D75P 34 – HNC Computer Architecture
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Computer Studies/ICT SS2
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Dale & Lewis Chapter 5 Computing components
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
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;
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Stored Program Concept Learning Objectives Learn the meaning of the stored program concept The processor and its components The fetch-decode-execute and.
CPU Lesson 2.
OCR GCSE Computer Science Teaching and Learning Resources
The Little man computer
Dr.Ahmed Bayoumi Dr.Shady Elmashad
CS 270: Mathematical Foundations of Computer Science
Chapter 10: Computer systems (1)
Control Unit Lecture 6.
Lecture 5: Computer systems architecture
Gunjeet Kaur Dronacharya Group of institutions
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
Computer Organization
Lesson Objectives A note about notes: Aims
Morgan Kaufmann Publishers
System Architecture 1 Chapter 2.
BASIC COMPUTER ORGANIZATION AND DESIGN
The Processor and Machine Language
CS149D Elements of Computer Science
Arithmetic Logical Unit
MARIE: An Introduction to a Simple Computer
CDCA 2203 Elements of Computer Architecture Open University Malaysia
Chapter 4: Representing instructions
1-2 – Central Processing Unit
Digital Circuits and Logic
A Level Computer Science Topic 5: Computer Architecture and Assembly
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.
Computer Operation 6/22/2019.
Computer Architecture
Presentation transcript:

Black Boxes and Abstraction or A quick run through how computers work Hugh Davis Learning Societies Lab ECS The University of Southampton, UK users.ecs.soton.ac.uk/hcd

What are Computers Computers deal with (binary) numbers They can store numbers They can add, subtract, multiply and divide numbers It can do logical operations (and/or/xor/not) on numbers And compare numbers And depending on the result they can choose to execute one bit of code or another That’s about it! The rest is down to coding– we have to represent the world in numbers

This Lecture The purpose of this lecture is to give you a very quick understanding of what’s “under the hood” At the same time we are going to see how computer scientists, having designed a working component then abstract it as a “black box” – and are no longer interested in what happens inside This approach was inspired by Andrew Tanenbaum’s “Structured Computer Organisation”

Prerequisit ANY Number can be represented in binary (base 2) Thus the number 110102 represents 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 = 16 + 8 + 0 + 2 + 0 = 2610 Because binary numbers can be long and difficult for humans, they are often represented in Octal or Hexedcimal = 328 = 1A H This is all covered in Chapter 1 of Brookshear

The Transistor When there is no Voltage at Vin the transistor will not conduct. So Vout will be same a VCC When a voltage is applied at Vin this will cause the transistor to conduct. Now Vout will be 0 So we have the following Vin Vout 0 1 1 0 In the world of Logic this is known as a NOT gate and represented thus:

The NAND Gate TTL chips integrate a number of transistors on a chip like this one.

More Logic You can make any logic gate from transistors in the same way as the NAND gate

Computers 101 To make a computer we are going to need to do a few essential things Compare numbers (if statements, branching relies on comparison) Add numbers Multiply/divide Numbers Store numbers

4 Bit Comparator This circuit will return a 1 if the 4 bit number A is the same as the 4 bit number B

Adding This half adder adds a A and B and produces a SUM (S) and a CARRY (C) This Full adder takes two bits A and B plus AND a Carry IN (Ci) and produces the SUM and Carry Out

Multiplication Multiplication is achieved by shifting. A shift 2 the left is multiplication by 2. A shift to the right is division by 2 0101 * 2 = 1010

A 1 Bit ALU F0 F1 Output =============== 0 0 A and B 0 1 A or B 1 0 Not B 1 1 A + B (with Carry)

Memory Memory can be made using a Latch – which will normally be clocked. This latch remembers whether the last pulse was on S or R and remains in that state even when the pulse has gone http://www.youtube.com/watch?v=7ruz82XpdUY&feature=related

Making a Computer Now we have all the components to make the Arithmetic Logic Unit of a computer and the memory. In Memory is a stored program and data. The CPU has an Accumulator and a Program Counter (the address of the next instruction)

Low Level Instructions Our 1 bit ALU had 4 instructions. Real processors have many more instructions, and rather than remembering the number for each of these instructions we tend to remember mnemonics LOAD <value > LOAD <address> Place the value or the contents of the address named in the accumulator. STORE <address> Place the contents of the accumulator in the address JUMP <address> Put address into the Program Counter JINEG <address> Put address into the Program Counter if the accumulator contains a negative value. JIZERO <address> Put address into the Program Counter if the accumulator contains zero. ADD <value> ADD <address> Add the value or the contents of the address to the accumulator. SUB, MULT and DIV As with ADD

Fetch Execute Cycle https://www.youtube.com/watch?v=04UGopESS6A The contents of the PC are put (via MAR) on address bus The PC is incremented Memory responds by fetching the contents of that address and returning along the data bus (to MDR and then to CIR)) The CPU decodes that data (CIR) as an instruction The CPU decodes and executes that instruction (which might involve moving more data to or from memory and Accumulator) https://www.youtube.com/watch?v=04UGopESS6A

High Level Languages Writing programs in machine code is difficult You need to know the instruction set of the target machine Dealing with representations of real numbers is complex You have to think about how things are organized in memory rather than how to solve the problem. So we invent “high level languages” which allow us to concentrate on the problem (and move the program to any target machine that has a compiler) Initial High Level languages had facilities targeted to the problem domain (e.g. COBOL, FORTRAN, ALGOL, LISP) More recently languages have tended to reflect the “paradigm” (Imperative structured, functional, declarative, object oriented) which represent different preferences and approaches to software engineering and problem solving.

Successive Language Abstractions