Intro to CS Chapt 2 Data Manipualtion 1 Data Manipulation How is data manipulated inside a computer? –How is data input? –How is it stored? –How is it.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

The CPU The Central Presentation Unit What is the CPU?
Stored Program Architecture
Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Computer Architecture and Data Manipulation Chapter 3.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Tenth Edition by J. Glenn Brookshear Chapter.
Processor Technology and Architecture
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Data Manipulation Computer System consists of the following parts:
Memory - Registers Instruction Sets
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
COMPONENTS OF THE SYSTEM UNIT
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Computer Organization Computer Organization & Assembly Language: Module 2.
Computer Processing of Data
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
Understanding Computers, Ch.31 Chapter 3 The System Unit: Processing and Memory.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Chapter 2 The CPU and the Main Board  2.1 Components of the CPU 2.1 Components of the CPU 2.1 Components of the CPU  2.2Performance and Instruction Sets.
Data Manipulation, Communication and Architecture Fall 2012.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Lesson 3 — How a Computer Processes Data Unit 1 — Computer Basics.
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
Ch. 2 Data Manipulation 4 The central processing unit. 4 The stored-program concept. 4 Program execution. 4 Other architectures. 4 Arithmetic/logic instructions.
General Concepts of Computer Organization Overview of Microcomputer.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Chapter 2 Data Manipulation. © 2005 Pearson Addison-Wesley. All rights reserved 2-2 Chapter 2: Data Manipulation 2.1 Computer Architecture 2.2 Machine.
Copyright © 2015 Pearson Education, Inc. Chapter 2: Data Manipulation.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
12/13/ _01 1 Computer Organization EEC-213 Computer Organization Electrical and Computer Engineering.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Data Manipulation Brookshear, J.G. (2012) Computer Science: an Overview.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
PC Internal Components Lesson 4.  Intel is perhaps the most recognizable microprocessor manufacturer. List some others.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Computer operation is of how the different parts of a computer system work together to perform a task.
Chapter 2: Data Manipulation
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.
CBP 2002ITY 270 Computer Architecture1 Module Structure Whirlwind Review – Fetch-Execute Simulation Instruction Set Architectures RISC vs x86 How to build.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
© 2015 Pearson Education Limited 2015 Quiz in last 15 minutes Midterm 1 is next Sunday Assignment 1 due today at 4pm Assignment 2 will be up today; due.
Computer Architecture
Functional Units.
CS149D Elements of Computer Science
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Chapter 2: Data Manipulation
Chapter 5: Computer Systems Organization
Chapter 2: Data Manipulation
Chapter 2: Data Manipulation
Chapter 4 The Von Neumann Model
Presentation transcript:

Intro to CS Chapt 2 Data Manipualtion 1 Data Manipulation How is data manipulated inside a computer? –How is data input? –How is it stored? –How is it output? –How is it transmitted to other computers? –What is machine language and how does it work?

Intro to CS Chapt 2 Data Manipualtion 2 Computer Architecture Central Processing Unit Main Memory Peripherals Bus (and sometimes Bluetooth devices, switches) for connecting parts Bus is a collection of wires and circuitry for transferring data, addresses, control information

Intro to CS Chapt 2 Data Manipualtion 3 PCI bus monitor Graphics controller Processor(s) cache(s) memorycontroller USB controller for USB bus/devices SCSI controller to SCSI bus and multiple disks ISA controller IDE controller to disks Parallel printers modem ISA bus mouse keyboard Serial printers, cameras, etc.

Intro to CS Chapt 2 Data Manipualtion 4 USB and FireWire Serial communication standards to handle a variety of devices to communicate through the serial port (bits sent one by one rather than in parallel) –Sample USB devices include Mice Keyboards Printers Scanners Digital cameras

Intro to CS Chapt 2 Data Manipualtion 5 DMA Controller that allows device to place data into assigned address or retrieve data from assigned address in main memory directly (direct memory access) –Device driver (via CPU) sends controller address of source, destination, amount of data to be transferred, operation –Controller informs device driver (via interrupt register in CPU) when operation completes

Intro to CS Chapt 2 Data Manipualtion 6 Communication devices for local loop Ethernet (IEEE802.3 wired LAN) NICs –Connected to port with cat 5 (3,6) twisted copper wire WiFi (IEEE ) wireless adaptor/NIC) Dial-up modem through existing telephone lines Modems for modulating digital input over analog waves DSL through existing telephone lines Cable modems through CATV cables FiOS – fiber and modem for the local loop Cellular phones – some WiFi enabled. Data rates in Kbps, Mbps, Gbps

Intro to CS Chapt 2 Data Manipualtion 7 Communicating with Devices Look at figure of PCI bus – today even memory has a controller (cache does not) Controller may be circuitry that is manufactured with device attached to it –controls and “translates” all data going between device & CPU (software in CPU is called a device driver) May be a general purpose controller that handles a number of different devices (SCSI, USB, or firewire controller)

Intro to CS Chapt 2 Data Manipualtion 8 Central Processing Unit Small 2” x 2” wafer with connecting pins –Connects to motherboard (main circuit board) 1) Control unit –Brains of the computer; sends signals (volts) to other units telling them what to do 2) Arithmetic/ Logic unit (ALU) performs data operations (+, and, etc.) 3) Registers, high speed memory buffers data, addresses that are being manipulated

Intro to CS Chapt 2 Data Manipualtion 9 Registers Some register functions –Hold input and output to/ from ALU –Hold addresses for Main Memory (MAR) –Hold data that will be written to memory; retrieved from memory (MDR) –Hold instruction being executed This register is called an Instruction Register (IR) –Hold address of next instruction to be executed. This register is called a program counter (PC).

Intro to CS Chapt 2 Data Manipualtion 10 Sample execution of instruction First part – fetch instruction Fetch instruction that is stored at address in PC Increment PC (even though the value may be overwritten) Second part- execute instruction –Example: C = A + B (A, B, C are memory locations) –Step 1. Get value in A from memory; store in register R1 –Step 2. Get value in B from memory; store in register R2 –Activate circuitry to output values from R1 and R2 (in turn) to ALU; add with result placed in temporary register in ALU; output this value to R3 –Store R3 into location C in memory

Intro to CS Chapt 2 Data Manipualtion 11 Stored program concept Initially, program was implemented with circuitry (e.g., data flow machines) Read/write memory held only data, not programs Stored program concept places program and data in memory –Originally, code was self modifying; operations could change instructions –Today there are efforts to protect code – only allow it to be executed (DEP)

Intro to CS Chapt 2 Data Manipualtion 12 Cache High speed memory directly available to CPU –Faster, smaller than main memory Hierarchies – L1, L2, L3 –Slower, larger than registers (1, 2MB perhaps) –Used to store parts of memory that have been recently accessed Principle of locality of reference There are also caches on devices

Intro to CS Chapt 2 Data Manipualtion 13 Machine Language Machine language is the language that the CPU interprets All machine instructions (except HALT) contain (at least): –Operation code Transfer of data to/from CPU (LOAD, STORE) Arithmetic/ logic operations (ADD, AND, SHIFT) Control (JUMP) –Operand (location or value) Location may be register, memory, even device address

Intro to CS Chapt 2 Data Manipualtion 14 Program Execution Machine cycles (these are continually repeated) –Fetch (next instruction) Place into instruction register contents of memory address in program counter Increment program counter (in our machine by 2) –Decode op code Interpret operands based on specific operation –Execute instruction

Intro to CS Chapt 2 Data Manipualtion 15 Simple Machine CPU ---- BUS --- Main memory Registers/ALU/control unit cell addresses R0 (in hex) (00 in hex) R1 (in hex) PC IR MDR MAR (FF in hex)

Intro to CS Chapt 2 Data Manipualtion 16 Machine Language Op codes for instructions (p.551) 4bit Op code 12bit operand Action 0001 R i XY R i  (XY) Copy bit string stored in memory location XY into register i 0010 R 1 XY R i  XY Copy the value XY ( XY is some bit string) into register i 0011 R i XY XY  (R i ) Copy the bit string stored in register i into the memory location XY 01000R i R k R k  (R i ) Copy the bit string in Register i into Register k 0101R i R k R m R i  (R k )+(R m ) In 2’s complement integer addition, add the values inside Register k and m and store result in register i 0110R i R k R m R i  (R k )+(R m ) Floating point addition

Intro to CS Chapt 2 Data Manipualtion 17 Machine Language 0111R 1 R 2 R 3 R 1  (R 2 ) OR (R 3 ) 1000R 1 R 2 R 3 R 1  (R 2 ) AND (R 3 ) 1001R 1 R 2 R 3 R 1  (R 2 ) XOR (R 3 ) logical operations between registers 1010 R 1 0X R 1  (rotate x bits in R 1 to the right) 1011 R 1 XY PC  (XY) if (R 0 ) = (R 1 ) else ignore R o XY is an unconditional jump (go to XY) HALT Example: in hexadecimal is 10A7; place value stored in A7 into R 0

Intro to CS Chapt 2 Data Manipualtion 18 Question Explain the execution of each step of the following program (implementation of adding two values stored in memory). Assume program starts at address C D E 08 C000 ( 1) copy value stored at 6C into register 5 (2) copy value stored at 6D into register 6 (3) Add values in register 5 and 6; place result into register 0 (4) Store value in register 0 into 6E (5) Halt

Intro to CS Chapt 2 Data Manipualtion 19 Code vs Data Note that code is data to compilers and other types of programs In the early days, code could be modified as if it were data Today code and data are kept separate, but if you were allowed to write into the code you could harm the system (discuss C pointers, viruses)

CISC vs RISC architecture Complex instruction set computing –Many complex instructions in hardware easier, faster for programmer to write even Apple has switched desktop from PowerPC to Intel Reduced Instruction set computing –Machine language composed of a minimal set of machine instructions Op code is represented by smaller number of bits (less op codes) Less expensive to manufacture Low power consumption (ARM) –Used widely in wireless systems Intro to CS Chapt 2 Data Manipualtion 20

Logical operations in Python Intro to CS Chapt 2 Data Manipualtion 21