1 of 37

Sri Raghavendra Educational Institutions Society (R)

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Krishna Institute of Technology

www.skit.org.in

Title:Data Storage AND data manipulation

MODULE:2

CO addressed: CO1

Course: Essentials of IT

Presented by: PREMA C R

Department: CSE

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

1

2 of 37

Chapter 2 :Data Manipulation

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

2

3 of 37

  • The CPU and main memory communicate through a set of wires called a bus, which transfers data and addresses between them.
  • The CPU reads data from memory by sending the cell address and a read signal,
  • CPU writes data by providing the address, data, and a write signal.

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

3

4 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

4

5 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

5

6 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

6

7 of 37

Stored-Program Concept

  • Early computers were inflexible because their operations were hardwired into the control unit, and changing tasks required physically rewiring the machine, often using a pegboard system.

  • The stored-program concept revolutionized this by realizing that a program, like data, can be stored in main memory.

  • If the CPU is designed to fetch, decode, and execute instructions from memory,

  • The program can be changed simply by modifying memory contents, without rewiring the CPU.

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

7

8 of 37

Machine Language

  • CPUs are designed to recognize instructions encoded as bit patterns. This collection of instructions along with the encoding system is called the machine language.
  • An instruction expressed in this language is called a machine level instruction or, more commonly, a machine instruction.
  • Two Architectures:

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

8

9 of 37

CISC

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

9

10 of 37

RISC Comparision

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

10

11 of 37

Categories of Machine Instructions

1

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

11

12 of 37

Arithmetic/Logic Instructions

  • The Arithmetic/Logic group consists of instructions that direct the Control Unit (CU) to initiate operations within the Arithmetic Logic Unit (ALU).
  • The ALU performs two main types of operations:
  • Arithmetic Operations
  • Logical and Bitwise Operations

2

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

12

13 of 37

3.Control Instructions

  • The Control group contains instructions that manage program execution flow, rather than performing operations on data.
  • To implement decision-making, loops, and conditional branching in programs.

Example: JUMP Step5

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

13

14 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

14

15 of 37

Structure of Machine Instruction

  • Each of these instructions is encoded using a total of 16 bits
  • op-code for each instruction consists of the first 4 bits->Specifies which operation to perform (like ADD, STORE, JUMP, etc.)

  • Operand field will be 12 bits->Provides details like which registers or memory addresses are involved.

Encoded instruction: 242B

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

15

16 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

16

17 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

17

18 of 37

Program Execution

Two registers are used mainly

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

18

19 of 37

Step 3: Execute

The CPU performs the operation specified by the op-code.

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

19

20 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

20

21 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

21

22 of 37

Arithmetic/Logic Instructions

  • Bitwise logical operations (AND and OR ,XOR) can be used for masking, i.e., selecting or modifying specific bits in a binary pattern.

  • EX:AND Masking used to make unwanted bits in results as “0’s”

Masking in Image Processing:

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

22

23 of 37

Checking if the 3 rd bit is 1 or not by using Mask as:00100000

Mask:11011111

OR Operation

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

23

24 of 37

AND → to test or clear bits (because 0 clears bits).�OR → to set bits (because 1 forces bits ON).�

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

24

25 of 37

XOR

  • Forming the complement (bit inversion)

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

25

26 of 37

Rotation and Shift Operations

Ex:5X2=10

0101🡪5 left shift 1010==10 in binary

Ex:6/2=3

6->0110->right shift

0011==3 in binary

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

26

27 of 37

Rotation:

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

27

28 of 37

In particular, if register 5 originally contained the bit pattern 65 (hexadecimal), then it would contain B2 after this instruction is executed

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

28

29 of 37

Communicating with Other Devices

  • Main memory and the CPU form the core of a computer.�Peripheral devices such as keyboards, printers, monitors, disks, cameras, and other computers communicate with this core through special hardware and techniques.

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

29

30 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

30

31 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

31

32 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

32

33 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

33

34 of 37

Direct Memory Access (DMA)

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

34

35 of 37

Handshaking

The CPU or controller checks these bits before sending more data.

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

35

36 of 37

Popular Communication Media

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

36

37 of 37

Sri Krishna Institut of Technology

(Approved by AICTE, Accredited by AC, Affiliated to VTU, Karnataka)

/skit.org.in

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

/skit.org.in

37