Study guide: Information Representation in Computing

Course Outline

  1. Positional Number Systems
  2. Character Coding and Hexadecimal
  3. Binary Addition and Subtraction
  4. Signed Integers and Two’s Complement
  5. Fixed-Point Representation
  6. IEEE 754 Single Precision
  7. IEEE 754 Double Precision

1. Positional Number Systems

Key Concepts & Definitions

  • Positional representation in base b: The positional representation of an integer N in base b is N=βˆ‘n=0+∞xnbnN=\sum_{n=0}^{+\infty}x_n b^n, where each digit x_n is between 0 and bβˆ’1, and the representation is unique.

β˜… Must-know

  • To convert a binary integer to decimal, multiply each bit by its corresponding power of 2 and add the products; for example, (1101010)2=106(1101010)_2=106.

Further detail

  • In decimal, 512 equals 5Γ—102+1Γ—101+2Γ—1005\times10^2+1\times10^1+2\times10^0.

  • The binary representation of decimal 65 is (1000001)2(1000001)_2.

2. Character Coding and Hexadecimal

Key Concepts & Definitions

  • ASCII: The American Standard Code for Information Interchange, used to encode characters.

β˜… Must-know

  • Binary is frequently used in computing because Boolean algebra underlies digital electronics.

  • The hexadecimal system is base 16 and uses A, B, C, D, E, and F for the values 10, 11, 12, 13, 14, and 15, respectively.

Further detail

  • Decimal values from 0 to 255 and characters are encoded using 8 bits.

  • The hexadecimal representations of decimal 255, 300, 256, 301, and 128 are FF, 12C, 100, 12D, and 80, respectively.

3. Binary Addition and Subtraction

β˜… Must-know

  • In binary addition, 0+0=0, 0+1=1, 1+0=1, and 1+1=0 with a carry of 1.
  • In binary subtraction, 1βˆ’0=1, 0βˆ’1=1 with a borrow of 1, 0βˆ’0=0, and 1βˆ’1=0.

Further detail

πŸ“Œ In binary subtraction, a borrowed unit is borrowed in binary and is returned in binary.

4. Signed Integers and Two’s Complement

Key Concepts & Definitions

  • Two’s complement: A binary method for representing signed integers and simplifying arithmetic operations.

β˜… Must-know

  • To obtain the two’s complement of a value, invert every bit to form the one’s complement, then add 1.

πŸ“ Formula - For a value Y, Y+Complement2⁑(Y)=0Y+\operatorname{Complement2}(Y)=0, so X+(βˆ’Y)=X+Complement2⁑(Y)X+(-Y)=X+\operatorname{Complement2}(Y).

Further detail

  • A signed integer representation on n bits reserves nβˆ’1 bits for the number and the final bit for the sign, according to the presented convention.

  • On 8 bits, +12 is 00001100, the one’s complement of 12 is 11110011, and its two’s complement is 11110100; adding these encodings gives 00000000.

πŸ“Œ In the presented 8-bit arithmetic, bits that exceed the reserved coding width are discarded.

Memory Hook

The one’s complement flips bits; the two’s complement adds one.

5. Fixed-Point Representation

Key Concepts & Definitions

  • Fixed-point representation: A number with an integer part and a fractional part, whose fractional digits are weighted by negative powers of the base.

β˜… Must-know

  • To convert a decimal fractional part to binary, repeatedly multiply the fraction by 2 and record each integer part in order; thus 0.25 is 0.01β‚‚.

Further detail

πŸ“ Formula - In base b, a fixed-point number with digits a_n…a_0 before the separator and b_1…b_m after it has value βˆ‘k=0nakbk+βˆ‘j=1mbjbβˆ’j\sum_{k=0}^{n}a_kb^k+\sum_{j=1}^{m}b_jb^{-j}.

  • The binary fixed-point representation of decimal 157.25 is 10011101.01β‚‚.

6. IEEE 754 Single Precision

β˜… Must-know

  • IEEE 754 single precision uses 32 bits: 1 sign bit, 8 exponent bits, and 23 mantissa bits, with base 2.

πŸ“ Formula - The represented number is expressed as X=(βˆ’1)sΓ—MΓ—bEX=(-1)^s\times M\times b^E, where s is the sign, M the mantissa, b the base, and E the exponent.

Further detail

  • πŸ”„ The decoding example proceeds as follows:

    1. Read the sign as negative.
    2. Calculate the exponent field as 130.
    3. Subtract the bias 127 to obtain an exponent of 3.
    4. Calculate the mantissa fraction as 0.1875.
    5. Evaluate βˆ’(1+0.1875)Γ—2Β³ to obtain βˆ’9.5.
  • To encode 18.125 in 32-bit single precision, write it as 10010.001β‚‚, normalize it to 1.0010001β‚‚Γ—2⁴, use sign bit 0, mantissa 00100010000000000000000 and exponent 131 (10000011β‚‚), producing 01000001100100010000000000000000.

7. IEEE 754 Double Precision

Essential Points

  • IEEE 754 double precision is presented as a 64-bit floating-point format.

Test yourself

Take a 8-question practice quiz on Information Representation in Computing, with every answer explained.

1. A technician converts the binary integer 101101121011011_2 to decimal by multiplying each bit by its corresponding power of 2 and adding. What value should the technician obtain?

2. Which property characterizes the positional representation of an integer in base bb?

Take the quiz β†’

Study with flashcards

Memorize the key concepts of Information Representation in Computing with 43 flashcards.

What is the positional representation of integer NN in base bb?

N=βˆ‘n=0+∞xnbnN=\sum_{n=0}^{+\infty}x_n b^n, where each digit xnx_n is between 00 and bβˆ’1b-1.

What is unique about an integer’s positional representation in base bb?

It is unique.

How do you convert a binary integer to decimal?

Multiply each bit by its corresponding power of 2 and add the products.

See the flashcards β†’

Related classes

Make your own study guides

Upload your class notes and Revizly writes a study guide, a quiz and flashcards in about a minute.

Study guide maker