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

Coa Module 2 Explain To Students

The document discusses computer data representation and operations. It covers how computers store and process information in binary form using bits and bytes. It also discusses different data types like numeric, non-numeric, and logical data that computers use. Specific types of numeric data like integers and real numbers are explained. The document also covers number systems, binary operations like addition, subtraction, and multiplication, and error detecting codes.

Uploaded by

B G JEEVAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Coa Module 2 Explain To Students

The document discusses computer data representation and operations. It covers how computers store and process information in binary form using bits and bytes. It also discusses different data types like numeric, non-numeric, and logical data that computers use. Specific types of numeric data like integers and real numbers are explained. The document also covers number systems, binary operations like addition, subtraction, and multiplication, and error detecting codes.

Uploaded by

B G JEEVAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 69

Revolutionising B.

Tech
Module 2: Data
Representation and
Operations in COA
Course Name: Computer Architecture and organization[22CSE104]
Total Hours : 08
Data Representation and Data Types

• Digital computers store and process information in binary form as digital logic
has only two values "1" and "0" or in other words "True or False" or also said as
"ON or OFF“.
• We human generally deal with
• Decimal ( Radix 10)
• Octal (Radix 8)
• Hexadecimal (Radix 16)
• Binary coded decimal (BCD),
Every computer's CPU has a width measured in terms of bits such as
• 8 bit CPU,
• 16 bit CPU,
• 32 bit CPU
• 64 bit CPU
Types of Cycles

Fetch cycle
It interprets the fetched memory content to be instruction and decodes
based on Instruction format.
Execute cycle
• The information from memory is considered as data
• As a common man think computers handle English or other alphabets, special
characters or numbers.
• A programmer considers memory content to be data types of the programming
language he uses,
Data Representation in Computers

• The number types to be represented (integer, real, signed, unsigned, etc.)


• Range of values likely to be represented (maximum and minimum to be
represented)
• The Precision of the numbers (floating point single precision, double
precision etc)
• If non-numeric i.e. character, character representation standard to be chosen.
ASCII, EBCDIC, UTF are examples of character representation standards.
• The hardware support in terms of word width, instruction.
Computer Architecture
Computer Architecture
Computer data types

Given below is different types of data that computer uses:


Numeric data – Integer and Real numbers
Non-numeric data – Character data, address data, logical data
Let’s study about each with further sub-categories.
Numeric data
• It can be of the following two types:
• Integers
• Real Numbers
Real numbers can be represented as:
• Fixed point representation
• Floating point representation
Computer data types

• Character data
• A sequence of character is called character data.
• A character may be alphabetic (A-Z or a-z), numeric (0-9), special character
(+, #, *,  @, etc.) or combination of all of these. A character is represented by
group of bits.
Example of character data
• Rajneesh1#
• 229/3, xyZ
• Mission Milap – X/10
Computer data types

Logical data

• A logical data is used by computer systems to take logical decisions.

• Logical data is different from numeric or alphanumeric data

• Logical data is denoted by either of two values true (T) or false(F).

• A logical data can also be statement consisting of numeric or character data


with relational symbols (>, <, =, etc.).
Computer data types

Character set

Character sets can of following types in computers:

• Alphabetic characters- It consists of alphabet characters A-Z or a-z.

• Numeric characters- It consists of digits from 0 to 9.

• Special characters- Special symbols are +, *, /,  -, ., <, >, =, @, %, #, etc.


Number Systems
Complements

Radix Complement

• The radix complement is referred to as the r's complement

Diminished Radix Complement

• The diminished radix complement is referred to as the (r-1)'s complement


Binary system complements

As the binary system has base r = 2.


So the two types of complements for the binary system are 2's complement and
1's complement.
• 1's complement
• The 1's complement of a number is found by changing all 1's to 0's and all
0's to 1's. This is called as taking complement or 1's complement. Example of
1's Complement is as follows.
2's complement

The 2's complement of binary number is obtained by adding 1 to the Least


Significant Bit (LSB) of 1's complement of the number.
2's complement = 1's complement + 1
Example of 2's Complement is as follows.
Binary Addition

It is a key for binary subtraction, multiplication, division. There are four rules of
binary addition.
Binary Subtraction

Subtraction and Borrow, these two words will be used very frequently for the
binary subtraction. There are four rules of binary subtraction.
Binary Multiplication

Binary multiplication is similar to decimal multiplication. It is simpler than


decimal multiplication because only 0s and 1s are involved. There are four
rules of binary multiplication.
Binary division

The binary division operation is similar to the base 10 decimal system, except
the base 2

• 1÷1 = 1
• 1÷0 = Meaningless
• 0÷1 = 0
• 0÷0 = Meaningless
ERROR DETECTING AND CORRECTING CODES

• In digital computer or a digital communication set-up, the issue of error


detection and correction is of great practical significance.

• Errors creep into the bit stream owing to noise

• While the addition bits helps in achieving the goal of making transmission of
information from one place to another error free or reliable,

• it also makes it inefficient.

20
ERROR DETECTING AND CORRECTING CODES

• Some Common Error Detecting and Correcting Codes

• Parity Code

• Repetition Code

• Cyclic Redundancy Check Code

• Hamming Code

21
ERROR DETECTING AND CORRECTING CODES

• Parity Code:
• A parity bit is an extra bit added to a string of data bits
• It was being stored or processed and moved from one place to another in a digital system.
• This simple parity code suffers from two limitations.
• It cannot detect the error if the number of bits having undergone a change is even.
• Repetition Code:
• The repetition code makes use of repetitive transmission of each data bit in the bit
stream.
• In the case of threefold repetition, ‘1’ and ‘0’ would be transmitted as ‘111’ and ‘000’
respectively.
• The repetition code is highly inefficient
• Data bit needs to be repeated to build error detection and correction capability.

22
ERROR DETECTING AND CORRECTING CODES

• Hamming Code:
• An increase in the number of redundant bits added to message bits
• It can enhance the capability of the code to detect and correct errors.
• If sufficient number of redundant bits arranged such that different error bits
produce different error results
• In fact, the addition of redundant bits alters the ‘distance’ code parameter,
which has come to be known as the Hamming distance.
• Hamming Distance:
• The Hamming distance is nothing but the number of bit disagreements
between two code words.

23
ERROR DETECTING AND CORRECTING CODES
• The algorithm for writing the generalized Hamming code is as follows:

1.The generalized form of code is P1P2D1P3D2D3D4P4D5D6D7D8D9D10D11P5......., where


P and D respectively represent parity and data bits.

2.We can see from the generalized form of the code that all bit positions that
are powers of 2 (positions 1, 2, 4, 8, 16 ...) are used as parity bits.

3.All other bit positions (positions 3, 5, 6, 7, 9, 10, 11 ...) are used to encode
data.

4.Each parity bit is allotted a group of bits from the data bits in the code word,
and the value of the parity bit (0 or 1) is used to give it certain parity.

24
ERROR DETECTING AND CORRECTING CODES

• The code word sequence for this code is written as P1P2D1P3D2D3D4, with
P1, P2 and P3 being the parity bits and D1, D2, D3 and D4 being the data bits.

• Generation of Hamming Code:

25
RTL
RTL
Register Transfer Language

• A digital system is an interconnection of digital hardware module.


• Digital systems varies in size and complexity from a few integrated circuits
• Digital system design invariably uses a modular approach.
• The modules are constructed from such digital components as
•Registers,
•Decoders,
•Arithmetic elements,
•Control logic.
Micro Operation in RTL

Define Micro Operation

• A micro operation is an elementary operation performed on the information


stored in one or more registers.
• Examples of micro operations
• Shift,
•Count,
•Clear,
•Load
RTL Internal Hardware

The internal hardware organization of a digital computer is best defined by


specifying:

•1. The set of registers it contains and their function.

•2. The sequence of micro operations performed on the binary information stored
in the registers.

•3. The control hardware register that initiates the sequence of micro operations.
RTL
Register Transfer Language Advantages

• RTL is a system for expressing in symbolic form.

• It is a convenient tool for describing the internal organization of digital computers

• It can also be used to design process of digital systems.

• The register transfer language adopted here with simple as possible.

• It should not take very long to memorize.


Registers

• Computer registers are designated by capital letters

• Sometimes followed by numerals

• For example,

1.MAR(Memory Address Register)

2.PC (Program Count)

3.IR (Instruction Register)

4.The individual flip-flops


Working Methods

Information transfer from oneregister to another is



designated in symbolic form by means of a replacement operator.

•The statement R2 <--R1 transfer of the content of register R1 into register R2.

• It designates a replacement of the content of R2 by the content of R l.

• By definition, the content of the source register R1 does not change after the

transfer.
Register Transfer Language

Figure 1 Block diagram of register.


Basic Symbols For Register

Symbol Description Examples


Letters and Represent a register MAR,R2
numerals
Parenthesis( ) Represent a part of resisters R290-70,R2(L)

Arrow Represent to transfer of R2 R1


information
Comma , Separates two R2 R1, R1 R2
microoperations
Bus and Memory Transfers

• A digital computer has many registers, and paths must be provided to transfer
information from one register to another.

• Separate lines are used between each register and all other registers in the
system.

• A more efficient scheme for transferring information between registers in a


multiple-register configuration is called as a common bus system.
Bus and Memory Transfers Architecture
Bus and Memory Transfers

• The two selection lines S1 and S0 are connected to the selection inputs of all
four multiplexers.
• The selection lines choose the four bits of one register and transfer them into
the four-line common bus.
• When S1S0 = 00, the 0 data inputs of all four multiplexers are selected and
applied to the outputs that form the bus.
• When S1S0 = 00 happens the bus lines to receive the content of register .
• Since the outputs of this register are connected to the 0 data inputs of the
multiplexers.
• Similarly, register B is selected if S1S0 = 01, and so on
Bus and Memory Transfers

Function table for Bus


S1 S0 Registers selected

0 0 A

0 1 B

1 0 C

1 1 D
Bus and Memory Transfers

• Three state bus buffers

•A bus system can be constructed with three-state gates instead of


multiplexers.
• A three-state gate is a digital circuit that followed by
• First two states are considered conventional state
•First states are signals equivalent to logic 0 and 1 as in a .
•Second gates are signal equivalent to logic 1 and 0 as in b
• The third state is a high-impedance state.
• Third gates are signal equivalent to logic 1 and 1 as in c
• Three-state gates may perform any conventional logic, such as AND or NAND.
Bus and Memory Transfers

Figure 2.4: Graphic symbol for 3 state buffers


Bus and Memory Transfers

Figure 2.5: Bus line with 3 state buffers


Memory Transfer
Basically Binary information's are stored from one register to another register.
Types
1.Read Operation
2.Write Operation
Read Operation
The transfer of information from a memory word to the outside environment is called a
read operation.
Write Operation
The transfer of new information to be stored into the memory is called a write
operation.
Access User Info

Administrator
Retrieve User Info
Display
Account User
Profile Info

User Account Info

Validate
Update User
Info
Enter/Update/ Delete User
Update/Delete User Info
Info
Arithmetic micro operations

• Binary Adder

To implement the binary adder micro operation with hardware .


• we need a register that hold the data in a digital component that
performs the arithmetic addition.
Types
1.Full Adder
The digital circuit that forms the arithmetic sum of two bits and a previous
carry is called a full-adder
2.Binary Adder
The digital circuit that generates the arithmeticsum of two
binary numbers of any lengths is called a binary adder.
Figure 2.6: Binary Adder
• Binary Adder - Subtractor

Remember that the subtraction A – B can be done by taking

the 2's complement of B and adding it to A.

The 2's complement can be obtained by taking the 1' s complement and adding

one to the least significant pair of bits.

The 1's complement can be implemented with inverters and a one can be added to the

sum through the input carry.


Figure 2.7: 4 - Bit Adder- Subtractor
• Binary lncrementer
• The increment micro operation adds one to a number in a register. For
example, if a 4-bit register has a binary value 0110, it will go to 0111 after it is
incremented.

• This micro operation is easily implemented with a binary counter every time the
count enable is active, the clock pulse transition increments the content of the
register by one.

• There may be occasions when the increment micro operation must be done with a
combinational circuit independent of a particular register.
Figure 2.8: 4- bit Binary incrementer
Arithmetic Circuit
• The arithmetic micro operations listed in below table can be implemented in one circuit.
• By controlling the data inputs to the adder, it is possible to obtain different types of arithmetic
operations
• A is the 4-bit binary number at the X inputs

• Y is the 4-bit binary number at the Y inputs of the binary adder.

• C in is the input carry, which can be equal to 0 or 1.

• Note that the symbol + in the equation above denotes an arithmetic plus.

• two selection inputs S1 and S0 and making Cin equal to 0 or 1


Logic Microoperations

• Logic micro operations specify binary operations for strings of bits stored in
registers.
• These operations consider each bit of the register separately and treat them as
binary variables.
• For example, the exclusive-OR micro operation with the contents of two registers
R 1 and R2 is symbolized by the statement

• P: R1 R1 ⊕ R2
• It specifies a logic micro operation to be executed on the individual bits of the
registers provided that the control variable P = 1.
•As a numerical example, assume that each register has four bits.
R1 be 1010
R2 be 1100
The exclusive-OR microoperation stated the following logic
computation:
• 1010 Content of R 1
• 1 100 Content of R2
• 0110 Content ofR 1 after P = 1
Shift Microoperations

• Shift micro operations are used for serial transfer of data.


Shift Microoperations

• Shift micro operations are used for serial transfer of data.


• They are also used in conjunction with
• Arithmetic and logic operations
• Data-processing operations.
• The information transferred through the serial input type of shift.
• There are three types of shifts:
•Logical,
• Circular
• Arithmetic.
Example
R1 SHL R1 (logical shift-left)
R2 SHR R2 (shift-right micro operations)
Logical LeftShift Microoperations
Logical Right Shift Microoperations
Circular Shift
• Arithmetic Logic Shift Unit
• Computer deploys a number of storage registers which is connected to a common
operational unit known as an arithmetic logic unit or ALU.
• ALU is the central and one of the most essential units internal the CPU of the
computer..
• All the logical and numerical operations of a computer are implemented here.
• The Arithmetic Logic Unit performs an operation that leads as a result and gets
.
transferred to a destination register.
• shift micro operations are performed in a separate unit, but sometimes it is made as a
part of full ALU. 
Storage Register
 

.
Thank you

You might also like