Data manipulation, Part one Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
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:
Processor System Architecture
Computer Architecture and Data Manipulation Chapter 3.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 14 Inside.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Tenth Edition by J. Glenn Brookshear Chapter.
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
1 Sec (2.1) Computer Architectures. 2 For temporary storage of information, the CPU contains cells, or registers, that are conceptually similar to main.
Data Manipulation Computer System consists of the following parts:
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Chapter 2.2 Machine Language.
Computer Organization and Assembly language
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
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.
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.
Information Representation: Machine Instructions
CPU Computer Hardware Organization (How does the computer look from inside?) Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge.
1 Programming in Machine Language SCSC 311 Spring 2011.
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.
Islamic University Of Gaza, Nael Aburas Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas
Ch. 2 Data Manipulation 4 The central processing unit. 4 The stored-program concept. 4 Program execution. 4 Other architectures. 4 Arithmetic/logic instructions.
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.
Chapter 2 Data Manipulation Yonsei University 1 st Semester, 2015 Sanghyun Park.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2 Data Manipulation. © 2005 Pearson Addison-Wesley. All rights reserved 2-2 Chapter 2: Data Manipulation 2.1 Computer Architecture 2.2 Machine.
Data Manipulation CSC Overview  Computer Architecture  Machine Language  Computer Architecture  Machine Language.
Copyright © 2015 Pearson Education, Inc. Chapter 2: Data Manipulation.
Computer Structure & Architecture 7b - CPU & Buses.
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.
Data Manipulation, part two Introduction to computer, 2 nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Register Transfer Languages (RTL)
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
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
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.
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.
27 October 2015 Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
CPIT Program Execution. Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the.
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.
Computers’ Basic Organization
Chapter 2: Data Manipulation
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
5 - How Computers Calculate - the ALU
The Processor and Machine Language
CS149D Elements of Computer Science
Computer Architecture
The Von Neumann Model Basic components Instruction processing
Chapter 2: Data Manipulation
Chapter 2: Data Manipulation
Machine Language.
Chapter 2: Data Manipulation
Presentation transcript:

Data manipulation, Part one Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information Technology Islamic University of Gaza Islamic University Of Gaza, Nael Aburas1

overview In this chapter we will study how computer manipulates the data. Moving data from one location to another Performing operations such as: arithmetic calculations, text editing, and so on. Islamic University Of Gaza, Nael Aburas2

Computer architecture  The circuitry in the computer that control the manipulation of data is called the CPU.  CPUs were large units comprised of several racks of electronic circuitry.  Today's, CPUs are packaged as small flat squares whose connecting pins plug into a socket mounted in the main board.  Due to their small size, these processors are called microprocessor. Islamic University Of Gaza, Nael Aburas3

CPU basics Consists of three parts ◦ Arithmetic/Logic unit  Performs operations on data (addition, subtraction) ◦ Control unit  Coordinating the machine’s activities ◦ Registers  Contain data storage cell that are used to temporary storage within the CPU.  (similar to main memory cells) Islamic University Of Gaza, Nael Aburas4

CPU basics  The registers hold the inputs to the arithmetic/logic unit and provide storage space for results produced by that unit.  The control unit transfer data from a main memory into registers, inform the arithmetic/logic unit which the register hold the data, activates the appropriate circuitry within the arithmetic/logic unit, and tells the arithmetic/logic unit which register should receive the result. Islamic University Of Gaza, Nael Aburas5

Bus For the purpose of transferring bit, a CPU and main memory are connected by a collection of wires called a bus. (wires connecting CPU and main memory) Through this bus, the CPU read data from main memory by supplying the address of the pertinent memory cell along with an electronic signal telling the memory that it is supposed to retrieve the data in the indicated cell. CPU writes data in memory by providing the address of the destination cell and the data to be stored together with electronic signal telling the main memory that it is supposed to store the data being sent to it. Islamic University Of Gaza, Nael Aburas6

Bus CPU and main memory are connected via a bus Islamic University Of Gaza, Nael Aburas7

Stored-program concept  The idea of storing a computer’s program “instructions” in the main memory.  Storage of instructions in computer memory to enable it to perform a variety of tasks in sequence Islamic University Of Gaza, Nael Aburas8

Machine language  Machine language: The set (collection) of all instructions recognized by a machine (CPU)  Machine instruction: An instruction (or command) encoded as a bit pattern recognizable by the CPU  Compilers and interpreters translate from high-level language to machine language Islamic University Of Gaza, Nael Aburas9

Machine language  RISC (reduced instruction set computer) CPU should be designed to execute a minimal set of machine instructions. (Few, simple, efficient, and fast instructions). In this architecture, such mahcine is efficent and fast.  CISC (complex instruction set computer) Ability to excute a large number of complex instructions. More complex cpu is easier to program because single instruction can be used to accomplish a task that would require a multi-instruction sequence in a RISC design. Islamic University Of Gaza, Nael Aburas10

Machine Instruction Types Machine instruction can be categorized into three grouping: ◦ Data transfer ◦ Arithmetic/logic ◦ control Islamic University Of Gaza, Nael Aburas11

Data transfer  Data transfer group consists of instructions that request the movement of the data from one location to another. Islamic University Of Gaza, Nael Aburas12

Data transfer A special terms are used when referring to the transfer of data between the CPU and the main memory ◦ A request to fill a register with the contents of a memory cells is referred to as a LOAD instruction. ◦ A request to transfer the contents of a register to a memory cell is called a STORE instruction. Islamic University Of Gaza, Nael Aburas13

Data transfer I/O instructions: the instructions that handle the input/output activities of the machine Islamic University Of Gaza, Nael Aburas14

Arithmetic/logic group The instruction that tell the control unit to request an activity within the arithmetic/logic unit. The arithmetic/logic unit perform the Boolean operations The instructions that allows the contents of registers to be moved to the right or the left within the register, such as SHIFT, ROTATE. Islamic University Of Gaza, Nael Aburas15

Control group These instructions direct the execution of the program. This group contains many of the instructions in the machine such as the family of JUMP instructions that used to direct the CPU to execute an instruction other than the next one in the list. Islamic University Of Gaza, Nael Aburas16

An illustrative machine language The machine instruction that will be described consists of two parts: Op-code ◦ Indicates which of the operations such as (STORE, SHIFT…etc) are requested by the instruction. Operand ◦ Provide more detailed information about the operation specified by the op-code The machine has 16 register and 256 main memory cells, each of capacity eight bit. For referencing purposes, the registers are labeled 0 through F, and the main memory cells are addressed 00 through FF. Islamic University Of Gaza, Nael Aburas17

An illustrative machine language  The machine language for our illustrative machine is are shown in Appendix C.  Each of these instructions is encoded using total of 16 bit, represented by four hexadecimal digits.  As shown in appendix c, the instruction that begin with op-code 3refer to a STORE instruction, and which begn with A refers to a ROTATE instruction.  If the op-code is 3, then the next hexadecimal digit of the instruction indicate which register is to be stored. Islamic University Of Gaza, Nael Aburas18

An illustrative machine language Example: 35A7, translates to the statement “ STORE the bit pattern found in register 5 in the main memory cell whose address is A7. Islamic University Of Gaza, Nael Aburas19

Figure 2.6 Decoding the instruction 35A7 Islamic University Of Gaza, Nael Aburas20

Appendix C: A Simple Machine Language Op-code OperandDescription 1RXY LOAD the register R with the bit pattern found in the memory cell whose address is XY. 3RXY STORE the bit pattern found in register R in the memory cell whose address XY. 5RST ADD the bit pattern in register S and T and leave the result in register R. (2’s comp.) Islamic University Of Gaza, Nael Aburas21

Adding values stored in memory Adding values stored in memory Islamic University Of Gaza, Nael Aburas22

An encoded version of the instructions in previous slide An encoded version of the instructions in previous slide Islamic University Of Gaza, Nael Aburas23

Exercise The following are instructions written in the machine language described in appendix C rewrite them in English. a)368A b)BADE c)803C d)40F4 Islamic University Of Gaza, Nael Aburas24

Exercise Here are some instructions in English. Translate each of them into the machine language of appendix C a)LOAD register number 3 with the hexadecimal value 56 b)ROTATE register number 5 three bits to the right c)AND the contents of register A with the contents of register 5 and leave the result in register 0 Islamic University Of Gaza, Nael Aburas25