Midterm Review October 23, 2001.

Slides:



Advertisements
Similar presentations
RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address
Advertisements

Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Lecture 1: Overview of Computers & Programming
The Binary Numbering Systems
Our First Real System.
Snick  snack A Working Computer Slides based on work by Bob Woodham and others.
Administrivia Any new students?
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Administrivia Assignments Labs Questions?? Class questions – –Goes to dpd and the TA’s Hand in lab assignments.
Traffic Light Behavior IF A=1 AND B=0 Car Sensors B A.
Administrivia New students? No class Thursday 9/27 Lab Problem Set Favorite browser and why Favorite search engine and why Questions??
Memory; Sequential & Clocked Circuits; Finite State Machines COS 116: 3/25/2008 Sanjeev Arora.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Addition : _________________ Binary Numbers (contd)
Machine Languages Different types of CPU’s understand different instructions Pentium family / Celeron / Xeon / AMD K6 / Cyrix … (Intel x86 family) PowerPC.
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
Memory. The logic and arithmetic circuits we’ve seen so far have no memory. They just transform input to output. Can we make circuits that remember? Memory.
Review: Our Friend the Logic Puzzle
Binary Arithmetic Math For Computers.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
How circuits acquire memory: Sequential & Clocked Circuits. COS 116, Spring 2011 Sanjeev Arora.
Memory; Sequential & Clocked Circuits; Finite State Machines
HARDWARE: CPU & STORAGE How to Buy a Multimedia Computer System.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Adding some light to computing ….
Overview of Computing. Computer Science What is computer science? The systematic study of computing systems and computation. Contains theories for understanding.
Chapter 2 Computer Hardware
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
CS 1308 Computer Literacy and the Internet. Exam Format  Approximately 120 Total Points  70 Points Multiple Choice  25 Points True or False  10 Points.
Intro to Computers Computer Apps 1.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
How Computers Work … and how you can work them. Art 315 Lecture 03 Dr. J Parker Fall 2010.
CSC 110 – Intro to Computing Lecture 8: Computing Components.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
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-100 Introduction to Computing Hardware Design Part I.
General Concepts of Computer Organization Overview of Microcomputer.
Computer Architecture And Organization UNIT-II General System Architecture.
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.
Computer Science 101 Computer Systems Organization.
Computer Organization & Assembly Language © by DR. M. Amer.
Computer System Internal components - The processor - Main memory - I / O controllers - Buses External components (peripherals). These include: - keyboard.
Lecture Overview – September 28, 2015 Housekeeping Questions about first assignment Questions about first lab Second assignment available today (due next.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
COMPUTER ORGANISATION I HIGHER STILL Computing Computer Systems Higher Marr College Computing Department 2002.
Exam Format  105 Total Points  25 Points Short Answer  20 Points Fill in the Blank  15 Points T/F  45 Points Multiple Choice  The above are approximations.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Concepts of Engineering and Technology Copyright © Texas Education Agency, All rights reserved.
Georgia Institute of Technology Speed part 1 Barb Ericson Georgia Institute of Technology May 2006.
Computers. Light A Review: State Machine IF A=1 AND B=0 Always IF A=0 AND B=1 Otherwise Light B Otherwise Always.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
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.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
Systems Architecture, Fourth Edition 1 Processor Technology and Architecture Chapter 4.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
ASSEMBLY LANGUAGE PROGRAMMING. Course Objectives Identify the major component of a PC-based system, describe the steps involving in assembling, linking,
Abstraction. Not real, not concrete A view that is removed from the reality Definitely has a "base" in reality – the "base" may be non-intuitive and not.
Lecture 07 – October 11, 2001 Programming our toy machine Review of hardware Storing images and sounds Compression Administrivia –send questions to
Lecture # 36 Computer Architecture and Organization.
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Everything is a number Everything in a computer memory and on storages is a number. Number  Number Characters  Number by ASCII code Sounds  Number.
CS 1308 Exam 2 Review.
Electronic Homework Submission and Grading
Logical Computer System
Branch instructions We’ll implement branch instructions for the eight different conditions shown here. Bits 11-9 of the opcode field will indicate the.
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
CS 1308 Exam 2 Review.
Presentation transcript:

Midterm Review October 23, 2001

Administrivia – The Midterm Problem solving What logic gates do How to build circuits that realize truth tables Addition circuitry Memory State machines to model situations Building the logic for state machines Putting it together to build a computer Programming the computer using machine language Representing information Understanding key ideas Von Neumann machine Moore’s law

Extra Midterm help DPD office hours Wednesday 2—4 My office, CS 219 Check with qlv and wtcorrea for other hours

More for Less --Moore’s Law Everything doubles every 18 months Memory/dollar Disk/dollar Transistors per inch Processor speed Network bandwidth

Practical Details Problem sets 20% Lab reports 10% Midterm exam 25% Final exam 25% Class Participation 20%

Building a computer

Layers of Abstraction Build more and more powerful tools out of simpler ones. Really Simple Stuff Computers

A Simple Logic Puzzle Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Alice and Bob decide to go, but Carol stays home. Will Frank go to the party?

Using 0’s and 1’s 0 = False 1 = True What do 0’s and 1’s mean? For now, we’ll take “Natural meanings:” For example, if we have a variable Alice for whether Alice goes to the party, If Alice goes, we write Alice = 1 If Alice doesn’t, we write Alice = 0 0 = False 1 = True

Logic Gates Computers are circuits made of Logic Gates. Logic gates manipulate 0’s and 1’s (False and True) by letting electrons flow or not. We’ll look at three types of Logic Gates: AND are all inputs true? OR is one input true? NOT flip the truth value

AND Gate AND W Y Z X W X Y Z 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

OR Gate W OR Z W X Y Z 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 X Y

NOT Gate Shorthand: Truth Table “Yanni will go to the party if Xena does NOT go.” X NOT Y Shorthand: X Y X Y 0 1 1 0 Truth Table

Logic Puzzle Circuit AND AND OR Alice Ed Frank Bob Dan Carole Dan will go if Bob does NOT go OR if Carole goes.

Given Any Truth Table A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0

Given Any Truth Table AND AND AND A B C F A 0 0 0 0 0 0 1 1 B 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 A AND B C A AND B C A AND B C Build AND gate for each output 1

Given Any Truth Table Finally, combine ANDs with an OR gate. AND F AND Can build logic for any Truth table this way AND B C

Universality Note same idea works no matter how many input variables. So for ANY Truth Table we can write down, we can make a circuit for it using only 3 Logic Gates: AND, OR, NOT This gives us a very powerful tool ! But, in practice, we are limited in size we can realize – numeracy exercise.

Our First Abstract Tool Universal Method: Circuits for ANY Truth Table 0’s & 1’s Universal Method Computers We are here

Powers of 2 (cont.) 210  1,000 (103 ) kilo Some rough numbers: 210  1,000 (103 ) kilo 220  1,000,000 (106 ) mega RAM 230  109 giga disk 240  1012 tera BIG disk 250  1015 peta 260  1018 exa knowledge

Representing Information We represent information with 0’s and 1’s Numbers Use binary or hexadecimal Letters Use ASCII Sounds Use samples Images Use pixels

Adding Binary Numbers AND sum OR AND carry AND X X Y sum 0 0 0 0 1 1 Y 0 0 0 0 1 1 1 0 1 1 1 0 Y sum OR X AND Y X Y carry 0 0 0 0 1 0 1 0 0 1 1 1 X carry AND Y

Addition We can use 1 building block to add numbers of any length. Black box operation ith bit of X ith bit of Z ith bit of Y carry bit out carry bit Abstraction in action -- This is a piece of a carry-ripple adder

Carry-Ripple Adder Z1 Z2 X2 Universal Circuit For Z2 and carry Z0 X1 Fixed at 0 X2 X1 X0 Y2 Y1 Y0 ============ C2 Z2 Z1 Z0

Memory

Enter Rita Matt doesn’t like Rita Matt decides to go to the party if Sue decides to go OR: If he (Matt) already feels like going AND Rita decides NOT to go. Sue OR Matt AND Rita Feedback Wire

The Flip-Flop OR AND M becomes 1 if Set is turned on Reset M becomes 1 if Set is turned on M becomes 0 if Reset is turned on Otherwise (if Set and Reset are both 0), M just remembers its value

The Flip-Flop S M R M becomes 1 if Set is turned on M becomes 0 if Reset is turned on Otherwise (if Set and Reset are both 0), M just remembers its value

The Data Flip-Flop D M Write If Write = 0, M just keeps its value. (It ignores D.) If Write = 1, then M becomes set to D

RAM Group 8 of them together. 8 bits (b) is called a byte (B). Most RAM is arranged in bytes. D M W D M W

RAM (cont.) We want a HUGE number of such 1 byte memory cells. Problem: How do we indicate which byte of memory we want to use at any given time? 1B 1B

RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address Data input Data Output Write 8 bits (1 byte) of data

On our way to building a computer… Review On our way to building a computer… Logic Circuits: Universal Method Represent Info with 0’s & 1’s (aka bits) 0’s & 1’s Memory Circuits Computers We are here

The System Clock “500 Mhz Pentium III computer…” What does “500 Mhz” mean? It refers to the speed of the System Clock. (actually this is only one of the clocks…) All digital systems have such “Clocks,” even traffic lights and elevator control systems.

Our System: A Traffic Light

A Traffic Light Intersection of two one-way roads A B Car Sensors

Light A Light B Traffic Light Behavior Otherwise Note: Clock beats every 4 sec. So Light is Yellow for 4 sec. IF A=1 AND B=0 Light A Always Always IF A=0 AND B=1 Otherwise Light B

Light A Light B Traffic Light State Machine Otherwise Note: Clock beats every 4 sec. So Light is Yellow for 4 sec. IF A=1 AND B=0 Light A Always Always IF A=0 AND B=1 Otherwise Light B

Light A Light B Traffic Light States 00 01 11 10 Otherwise IF A=1 AND B=0 00 01 Light A Always Always IF A=0 AND B=1 11 10 Otherwise Light B

Traffic Light Behavior Build A Truth Table for next state / Output M1 M2 A B D1 D2 Light A Red Light B Red … 0 0 1 0 0 1 1 0 0 1 * * 1 0 1 0 1 0 0 1 1 1 0 1 1 1 * * 0 0 0 1 0 0 0 0 0 0 1 0 … … … … … … …

Traffic Light Design Current State 2-bit Memory Logic Register For Next State & Output Clock Sensor A 6 Outputs: for each Light Sensor B

Design for Any State Machine Many bits Current State Memory Register Logic For Next State & Output Clock Inputs Outputs

State Machines in Real Life Elevator control systems Car control systems VCR’s Alarm Clocks Personal Computers … Just about everything!

Computers

Computer Architecture CPU Keyboard Display Bus Hard Disk CD-ROM RAM

The Bus Communication on the bus is via postcards CPU Keyboard Display CPU puts “Keyboard, did the user type anything?” (represented in some way) on the Bus. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Each device (except CPU) is a State Machine that constantly checks to see what’s on the Bus. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Keyboard notices that its name is on the Bus, and reads info. Other devices ignore the info. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Keyboard then writes “CPU: Yes, user typed ‘a’.” to the Bus. Display Bus “CPU: Yes, user typed ‘a’.”

The Bus At some point, CPU reads the Bus, and gets the Keyboard’s response. CPU Keyboard Display Bus “CPU: Yes, user typed ‘a’.”

The CPU (cont.) Memory Registers Register 0 Arithmetic / Logic Unit Control Unit (State Machine) Instruction Register Instr. Pointer (IP)

Important Point One of the important features of the von Neumann model is the fact that: The instructions themselves And The data the instructions manipulate are all stored in the same RAM. This was one of the revolutionary features of the modern computer, totally unlike Punch-Card computers proposed in the past.

Important Point This innovation is crucial to modern computing. It even allows for the possibility of programs that change themselves as they are executed. With great power comes great risk… Computer Viruses!

Machine Language We now have a machine that can execute instructions. Basic Questions: What instructions? How do computers understand these instructions? (Representation) What does software look like to a computer?

Instructions 16 possible Op-Codes: 0: halt 1: add 2: subtract 3: multiply 4: bus output 5: jump 6: jump if positive 7: jump & count 8: bus input 9: load A: store B: load direct/addr. C: NAND D: AND E: Shift Right F: Shift Left

Adding Numbers Simple Program to calculate 1 + 2 + 3 + 4 + 5 + 6 = 21 = 15 (hex) 10: Load R0  0001 (always 1) 11: Load R2  0000 (running total) 12: Load R1  0001 (current number) 13: Add R2  R2 + R1 (R2=1) 14: Add R1  R1 + R0 (R1=2) 15: Add R2  R2 + R1 (R2=3) 16: Add R1  R1 + R0 (R1=3) 17: Add R2  R2 + R1 (R2=6) 18: Add R1  R1 + R0 (R1=4) 19: Add R2  R2 + R1 (R2=A) 1A: Add R1  R1 + R0 (R1=5) 1B: Add R2  R2 + R1 (R2=F) 1C: Add R1  R1 + R0 (R1=6) 1D: Add R2  R2 + R1 (R2=15) 1E: halt

Adding Numbers Alternate Loop using Jump & Count for 1 + 2 + 3 + 4 + 5 + … + N 10: Load R1  0006 (N) 11: Load R2  0000 (running total) 12: Add R2  R2 + R1 (add in N) 13: Jump to 12 and (If N isn’t 0 yet, decrease R1 if (R1>0) Let N=N-1, and go back) 14: halt (N is now 0, and R2 = 1+2+…+N)

Sound is a waveform

Sampling the waveform

The approximation

Even finer sampling

Digital vs. Analog A sound file is just a sequence of bytes On a CD, the sampling rate is 44,100 samples per second. Each sample is quantized into a number in the range from 0 to 65,535, So a CD has 44,100 numbers (each 2 bytes) per channel per second of music. A graphic image is just a sequence of bytes An image is made up of pixels Each pixel might be represented by 3 bytes giving color intensities. Manipulating sounds or images just involves manipulating numbers

Numeracy CD has 44,100 2 byte samples per second. 44,100 x 2 x 60 x 2 (channels) = 10.09 megabytes per CD minute A CD is 74 minutes (746 megabytes) long. MP3 players typically use memory 32 or 64 megabytes in size. (or 3-6 minutes) Compression is needed

The need for compression A CD is 746 megabytes long A printed page requires 86.4 Megabytes of storage

Simple compression Simple compression More complex compression Use redundancy More complex compression Lossy vs. lossless Ideas for lossy Drop frequencies you can’t hear Drop small differences you won’t notice

More complex compression Lossy compression Can save space by eliminating parts of the image/sound that don’t matter very much Big savings compared to lossless, but the signal cannot be fully recovered. Ideas Dropping frequencies you can’t hear Dropping small differences you won’t notice Generally large savings compared to lossless

Pause for experiment