1 Ethics of Computing MONT 113G, Spring 2012 Session 7 Computer Architecture The Internet.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
CompSci A Peek at the Lower Levels  It is good to have a sense of what happens at the hardware level  Not required for this course  It may.
The Little man computer
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
4/15/2003CSCI 150: Introduction to Computer Science - Session 231 Introduction to Computer Science CSCI 150 Section 002 Session 23 Dr. Richard J. Bonneau.
LC-3 Computer LC-3 Instructions
Execution of an instruction
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Stored Program Concept: The Hardware View
Assembly Language Programming. CPU The CPU contains a Control Unit, Arithmetic Logic Unit (ALU) and a small number of memory locations called Registers.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
1 CS Programming Languages Random Access Machines Jeremy R. Johnson.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Basic Operational Concepts of a Computer
Processor Structure & Operations of an Accumulator Machine
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
1 Ethics of Computing MONT 113G, Spring 2012 Session 8 The Internet HTML.
Cosc 2150: Computer Organization
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
Computer Architecture and the Fetch-Execute Cycle
Computer Architecture and the Fetch-Execute Cycle
Computer Science 101 How the Assembler Works. Assembly Language Programming.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Execution of an instruction
Computer Organization CSC 405 (VSC) Very Simple Computer.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
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.
1.4 Representation of data in computer systems Instructions.
Dale & Lewis Chapter 5 Computing components
CompSci Today’s topics Machine Architecture The basic machine Basic programming Assembler programming Upcoming Language Translation Reading Great.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Program to multiply 2 numbers 500-Input x 291-Store acc. as x 500-Input y 292-Store acc. as y 193-Load y in to acc. (0 on 1 st parse) 391-Add x to acc.
The Little man computer
Distributed Systems.
Computers and Society HNRS 299, Spring 2017 Session 19 HTML
CPU Organisation & Operation
Assembly Language Assembly Language
Assembly Language Programming Part 2
Chapter 4 The Von Neumann Model
Chapter 5 The LC-3.
The Processor and Machine Language
Hmmm Assembly Language
Systems Architecture I (CS ) Lecture 1: Random Access Machines
CSCE Fall 2013 Prof. Jennifer L. Welch.
Computer Science 210 Computer Organization
CSCE 121: Simple Computer Model Spring 2015
The Von Neumann Architecture Odds and Ends
CSCE Fall 2012 Prof. Jennifer L. Welch.
Program Execution.
Chapter 8: Instruction Set 8086 CPU Architecture
Hmmm Assembly Language
Instruction execution and ALU
Computer Architecture Assembly Language
Computer Architecture
Systems Architecture I (CS ) Lecture 1: Random Access Machines
Sec (2.3) Program Execution.
Little Man Computer.
Presentation transcript:

1 Ethics of Computing MONT 113G, Spring 2012 Session 7 Computer Architecture The Internet

2 Computer Organization Two Major Sub-Parts: CPU with registers Memory where instructions and data are stored CPU with registers instruction pointer (IP) register, often called the program counter (PC) instruction register (IR) condition flag (CF) computation register (AX), often called the accumulator general purpose registers

The P88 Machine: 1 computational register (AX) 12 Instructions (plus END) COPY AX, mem copy from mem, AX = mem COPY mem, AX copy to mem, mem = AX ADD AX, mem add, AX = AX + mem SUB AX, mem subtract, AX = AX - mem MUL AX, mem multiply, AX = AX * mem DIV AX, mem divide, AX = AX / mem CMP AX, mem compare, if AX < mem then CF = B else CF = NB JMP label jump, goto instr marked with label JNB label jump if not below, goto instr w/ label, if CF==NB otherwise goto next instr JB label jump if below, goto instr w/ label, if CF==B otherwise goto next instr IN AX input, integer input to AX OUT AX output, integer output from AX END halt, stop execution

4 Fetch-Execute Cycle Repeat Forever: Fetch the next instruction use address in IP to get instruction Increment the IP (program counter) Decode the instruction Execute the instruction

5 Program Execution instruction pointer (IP) 11 instruction register (IR) accumulator register (AX) : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

6 Program Execution instruction pointer (IP) 11 instruction register (IR) copy AX, X accumulator register (AX) : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

7 Program Execution instruction pointer (IP) 12 instruction register (IR) copy AX, X accumulator register (AX) : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

8 Program Execution instruction pointer (IP) 12 instruction register (IR) copy AX, X accumulator register (AX) 4 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

9 Program Execution instruction pointer (IP) 12 instruction register (IR) add AX, Y accumulator register (AX) 4 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

10 Program Execution instruction pointer (IP) 13 instruction register (IR) add AX, Y accumulator register (AX) 4 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

11 Program Execution instruction pointer (IP) 13 instruction register (IR) add AX, Y accumulator register (AX) 7 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

12 Program Execution instruction pointer (IP) 13 instruction register (IR) copy Z, AX accumulator register (AX) 7 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

13 Program Execution instruction pointer (IP) 14 instruction register (IR) copy Z, AX accumulator register (AX) 7 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 200 (Z) : CPU: Memory:

14 Program Execution instruction pointer (IP) 14 instruction register (IR) copy Z, AX accumulator register (AX) 7 : 11copy AX, X 12add AX, Y 13copy Z, AX : : 1E4 (X) 1F3 (Y) 207 (Z) : CPU: Memory:

15 Example Read two numbers, multiply them, and then print the result. in AX copy Y, AX inAX multAX, Y outAX

16 Example Reads how many numbers(>0), then numbers, sums and outputs. ONE1 //1 conveniently stored in memory in AX copy CT, AX //stores a ct in memory subAX,CT copyZERO, AX //stores a 0 in memory copySUM, AX //initialize sum to 0 LOOPinAX //get a number addAX,SUM //add to sum copySUM,AX //store new sum copyAX, CT //gets ct from memory subAX,ONE //decrement ct copy CT, AX //stores new ct in memory cmpAX,ONE //if AX < 1 then CF =B, else CF=NB jnbLOOP //do again copyAX,SUM //get SUM back in the accumulator outAX //output SUM end //halt

Format: Python Code translation Assembly Language Code translation Machine Language Code Execution by Electric Circuitry Example: Z = X + Y translation copy AX, X add AX, Y copy Z, AX translation Execution of codes , , Language Translation: Higher Level Languages (like Python) are translated to Lower Level Languages (like assembly language or machine language.)

18 How is this done? Production rules are recognized in the source language (syntax recognition) Compute meaning "semantics" for each entity recognized This computed meaning eventually generates object code. Production rules would recognize the string: Z = X + Y Lots of bookkeeping--are they all legal variables, get addresses for the variables, etc. Then "output" equivalent code: copy AX, X add AX, Y copy Z, AX

19 History of the Internet The next two slides summarize the information available in the slide show found at: 1. The internet started as ARPAnet (Advanced Research Projects Agency). 2. Other networks started forming: bitnet, CSnet, NSFnet, etc. 3. These networks became interconnected to form the internet. 4. Several organizations oversee the internet: Internet Society Internet Corporation for Assigned Names and Numbers (ICANN) Network Information Services

20 TCP/IP The Internet is a Packet Switched Network--messages are sent as packets. Messages are sent across the web using the TCP/IP protocols Transmission Control Protocol (TCP) breaks up the messages and puts on header information regarding the order of packets and for error checking. Internet Protocol (IP) addresses the packets and sends them across the internet. The packets don’t all necessarily follow the same route or arrive in the correct order. IP unpacks the packets at their destination. TCP puts the packets in their proper order at the end.