Posts

Showing posts from April, 2015

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 has two symbols: 0 and 1, called bits.  It is also a positional notation. for example,