Posts

Integer Representation(Signed and Un-signed Numbers)

Computers use a fixed number of bits to represent an integer.  The commonly-used bit-lengths for integers are 8-bit, 16-bit, 32-bit or 64-bit.  Besides bit-lengths, there are two representation schemes for integers: Unsigned Integers: can represent zero and positive integers. Signed Integers: can represent zero, positive and negative integers. n-bit Unsigned Integers Unsigned integers can represent zero and positive integers, but not negative integers. Example 1: Suppose that n=8 and the binary pattern is 0100 0001B, the value of this unsigned integer is 1×2^0 + 1×2^6 = 65D. Example 2: Suppose that n=16 and the binary pattern is 0001 0000 0000 1000B, the value of this unsigned integer is 1×2^3 + 1×2^12 = 4104D. Signed Integers Signed integers can represent zero, positive integers, as well as negative integers. Three representation schemes are available for signed integers: Sign-Magnitude representation 1's Complement representation 2's Complement...

Unsigned and Signed Numbers

Data Representation Integer Representation(Signed and Un-signed Numbers)

Data Representation

Number Systems Human beings use decimal (base 10) number systems for counting and measurements. Computers use binary (base 2) number system, as they are made from binary digital components (known as transistors) operating in two states - on and off. In computing, we also use hexadecimal (base 16) or octal (base 8) number systems, as a compact form for represent binary numbers. Decimal (Base 10) Number System Decimal number system has ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, called digits. It uses positional notation. That is, the least-significant digit (right-most digit) is of the order of 10^0 (units or ones), the second right-most digit is of the order of 10^1 (tens), the third right-most digit is of the order of 10^2 (hundreds), and so on.  For example,                                735 = 7×10^2 + 3×10^1 + 5×10^0 Binary (Base 2) Number System Binary number system...

Encoding of Information

In computers, encoding is the process of putting a sequence of characters (letters, numbers, punctuation, and certain symbols) into a specialized format for efficient transmission or storage. Decoding is the opposite process -- the conversion of an encoded format back into the original sequence of characters. Encoding and decoding are used in data communications, networking, and storage. The code used by most computers for text files is known as ASCII (American Standard Code for Information Interchange). ASCII can depict uppercase and lowercase alphabetic characters, numerals, punctuation marks, and common symbols. Other commonly-used codes include Unicode, BinHex and Uuencode. In data communications, Manchester encoding is a special form of encoding in which the binary digits (bits) represent the transitions between high and low logic states. Operation Code (Opcode) It specifies the operation to be performed. The operation of the CPU is determined by the instructi...

Program

Image
A set of instructions that perform a task is called a program usually a program is stored in the memory. The processor then fetches the instructions comprising the program from memory one at a time and perform the desired operations. The computer is under control of stored program,except for the possibility of external interruption from the operator or by I/O devices connected to the machine. The operation of the CPU is determined by the instructions it executes. These instructions are referred to as machine instructions or computer instructions. The collection of different instructions that the CPU can execute is referred to as the CPU‟s instruction set. Example Program                           Compute (X+Y)Z                           MVI B, X                           MVI A,Y ...

Instruction sets

Image
Steps involved in instruction execution in CPU Instructions and data are the information fed to a computer. Instructions are explicit commands that Govern the transfer of information within a computer as well as between the computer and its I/O devices. Specify the arithmetic and logic operations to be performed. A set of instructions that perform a task is called a program usually a program is stored in the memory. The processor then fetches the instructions comprising the program from memory one at a time and perform the desired operations. The computer is under control of stored program, except for the possibility of external interruption from the operator or by I/O devices connected to the machine. The operation of the CPU is determined by the instructions it executes. These instructions are referred to as machine instructions or computer instructions. The collection of different instructions that the CPU can execute is referred to as the CPU‟s instruction set. Ea...

WORD

The main memory contains a large number of semiconductor storage cells each capable of storing one bit of information. These cells are processed in groups of fixed size called words. The main memory is organized so that the contents of one word containing n bits can be stored or retrieved in one basic operation. To provide easy access to any word in memory, a distinct address is associated with each word location. A given word is accessed by specifying its address and issuing a control command that starts the storage or retrieval process. The time required to access one word is called memory access time. The number of bits in each word is often referred to as the word length of the computer. Large computers have usually 32 or more bits in a word and micro computer word lengths range from 8 to 32 bits. The capacity of the main memory is few hundred thousand words, whereas medium and large machines normally have millions of words. Data are manipulated within a machine in uni...