0% found this document useful (0 votes)
14 views

NMCNTT 4 Data Manipulation AAA (1) (3)

The document provides an overview of data manipulation in computer architecture, focusing on the Central Processing Unit (CPU), its components, and the execution of machine language instructions. It explains the roles of the arithmetic/logic unit, control unit, and the machine cycle, detailing how programs are executed through fetching, decoding, and executing instructions. Additionally, it discusses different machine language philosophies and instruction types, highlighting the importance of registers and the bus system in data processing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

NMCNTT 4 Data Manipulation AAA (1) (3)

The document provides an overview of data manipulation in computer architecture, focusing on the Central Processing Unit (CPU), its components, and the execution of machine language instructions. It explains the roles of the arithmetic/logic unit, control unit, and the machine cycle, detailing how programs are executed through fetching, decoding, and executing instructions. Additionally, it discusses different machine language philosophies and instruction types, highlighting the importance of registers and the bus system in data processing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

DATA MANIPULATION

Computer Science: An Overview by J. Glenn Brookshear and Dennis Brylow publisher Pearson
Data Manipulation
 Computer Architecture
 Machine Language
 Program Execution
 Arithmetic/Logic Instructions

2
COMPUTER ARCHITECTURE
Computer Architecture
 Central Processing Unit (CPU) or processor
 Arithmetic/Logic unit versus Control unit
 Registers
 General purpose
 Special purpose
 Bus
 Motherboard

4
CPU and main memory connected via
a bus

5
Motherboards
 The motherboard
 is the main printed circuit board.
 contains the buses, or electrical
pathways found in a computer.
Buses allow data to travel
among the various components.
 accommodates CPU, RAM,
expansion slots, heat sink/fan
assembly, BIOS chip, chip set,
sockets, internal and external
connectors, various ports, and
the embedded wires that
interconnect the motherboard
components.

6
Central Processing Unit
 The Central Processing Unit (CPU) is known as the brain
of the computer. It is also referred to as the processor.
 The CPU executes a program, which is a sequence of
stored instructions.

7
Central Processing Unit
 Some CPUs incorporate hyperthreading or
hypertransport to enhance the performance of the CPU.
 The amount of data that a CPU can process at one time
depends on the size of the processor data bus.
 Speed of the CPU is measured in cycles per second -
megahertz (MHz) or gigahertz (GHz).
 Overclocking is a technique used to make a processor
work at a faster speed than its original specification.

8
Central Processing Unit
 The latest processor technology has resulted in CPU
manufacturers finding ways to incorporate more than one
CPU core onto a single chip.
 Dual Core CPU - Two cores inside a single CPU
 Triple Core CPU - Three cores inside a single CPU
 Quad Core CPU - Four cores inside a single CPU
 Hexa-Core CPU - Six cores inside a single CPU
 Octa-Core CPU - Eight cores inside a single CPU

9
The Arithmetic/Logic Unit
 Subsystem that performs addition, subtraction, and
comparison for equality
 Components
 Registers, interconnections between components, and the
ALU circuitry
 Register
 Storage cell that holds the operands of an arithmetic
operation and holds its result
 Bus
 Path for electrical signals

10
The Arithmetic/Logic Unit
 Registers are similar to RAM with following minor
differences
 They do not have a numeric memory address but are
accessed by a special register designator such as A, X or R0
 They can be accessed much more quickly than regular
memory cells
 They are not used for general purpose storage but for
specific purposes such as holding the operands for an
upcoming arithmetic computations.
 A typical ALU has 16, 32 or 64 registers.

11
The Control Unit
 Control unit
 Tasks: fetch, decode, and execute

12
MACHINE LANGUAGE
Stored Program Concept
 A program can be encoded as bit patterns and stored in
main memory.
 From there, the CPU can then extract the instructions and
execute them.
 In turn, the program to be executed can be altered easily.

14
Terminology
 Machine instruction: An instruction (or command)
encoded as a bit pattern recognizable by the CPU

 Machine language: The set of all instructions recognized


by a machine

15
Machine Language Philosophies
 Reduced Instruction Set Computing (RISC)
 Few, simple, efficient, and fast instructions
 Examples: PowerPC from Apple/IBM/Motorola and ARM

 Complex Instruction Set Computing (CISC)


 Many, convenient, and powerful instructions
 Example: Intel

16
Machine Instruction Types
 Data Transfer: copy data from one location to another
 Arithmetic/Logic: use existing bit patterns to compute a
new bit patterns
 Control: direct the execution of the program

17
Adding values stored in memory

18
Dividing values stored in memory

19
An architecture of the machine

20
Parts of a Machine Instruction
 Op-code: Specifies which operation to execute
 Operand: Gives more detailed information about the
operation
 Interpretation of operand varies depending on op-code

21
The composition of an instruction

22
Decoding the instruction 35A7

23
A Simple Machine Language

Op-code Operand Description


1 RXY LOAD reg. R from cell XY.
2 RXY LOAD reg. R with XY.
3 RXY STORE reg. R at XY.
4 0RS MOVE R to S.
5 RST ADD S and T into R. (2’s comp.)
6 RST ADD S and T into R. (floating pt.)

24
A Simple Machine Language

Op-code Operand Description


7 RST OR S and T into R.
8 RST AND S and T into R.
9 RST XOR S and T into R.
A R0X ROTATE reg. R X times.
B RXY JUMP to XY if R = reg. 0.
C 0 HALT.

25
A Simple Machine Language
 14A3: Load
 The contents of the memory cell located at address A3 to
be placed in register 4.
 20A3: Load
 The value A3 to be placed in register 0.
 35B1: Store
 The contents of register 5 to be placed in the memory cell
whose address is B1.
 40A4: Move
 The contents of register A to be copied into register 4.

26
A Simple Machine Language
 5726: Add
 The binary values in registers 2 and 6 to be added and the
sum placed in register 7.
 634E: Add
 The values in registers 4 and E to be added as floating-
point values and the result to be placed in register 3.

27
A Simple Machine Language
 7CB4: Or
 The result of ORing the contents of registers B and 4 to be
placed in register C.
 8045: And
 The result of ANDing the contents of registers 4 and 5 to be
placed in register 0.
 95F3: Xor
 The result of XORing the contents of registers F and 3 to be
placed in register 5.
 A403: Rotate
 The contents of registers 4 to be rotated 3 bits to the right in
a circular fashion.
28
A Simple Machine Language
 B43C:
 Compare the contents of register 4 with the contents of
register 0.
 If equal, the pattern 3C would be placed in the program
counter so that the next execution executed would be the
one located at that memory address.
 Otherwise, nothing would be done.
 C000:
 Stop program execution.

29
An encoded version of the instructions

QUIZ
30
PROGRAM EXECUTION
Program Execution
 Controlled by two special-purpose registers
 Program counter: address of next instruction
 Instruction register: current instruction
 Machine Cycle
 Fetch
 Decode
 Execute

32
The machine cycle

33
Decoding the instruction B258

34
A program stored in main memory

35
The fetch step of the machine
cycle

36
The fetch step of the machine cycle

37
ARITHMETIC/LOGIC
INSTRUCTIONS
Arithmetic/Logic Operations
 Logic: AND, OR, XOR
 Masking
 Rotate and Shift:
 circular shift (rotation)
 logical shift
 arithmetic shift
 Arithmetic: add, subtract, multiply, divide
 Precise action depends on how the values are encoded
(two’s complement versus floating-point).

39
Masking

40
Circular shift

41
Logical shift

QUIZ 42

You might also like