Book cover for Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow

ISBN #9781292061160

12th Edition

662 Questions

Group icon
18,100 Students Helped

Homework Questions

Right arrow
Summary

Learning Objectives

Key Concepts

Example Problems

Explanations

Common Mistakes

Summary

This chapter explores the fundamental methods of data storage in computers, emphasizing binary encoding schemes such as two’s complement, excess notation, and floating-point representations. It underscores the importance of error detection and correction techniques, including parity bits and Hamming codes, in enhancing data reliability. By integrating Python programming with hardware principles, the chapter provides a holistic view of how theoretical concepts are applied in practical computer engineering to manage and manipulate data efficiently.

Learning Objectives

1

Explain how computers encode and store data using binary representations.

2

Identify and apply various encoding schemes including two’s complement, excess notation, and floating-point representations.

3

Understand the role of data compression, error detection, and error correction techniques in maintaining data reliability.

4

Translate low-level data manipulation concepts into higher-level applications using Python programming.

5

Integrate knowledge of hardware design with data handling methodologies to analyze data storage systems.

Key Concepts

CONCEPT

DEFINITION

Bit

The smallest unit of data in a computer, representing a binary value of 0 or 1.

Binary Representation

A method of representing data using two symbols, typically 0 and 1, to encode information.

Two’s Complement

A binary encoding scheme for representing integers that simplifies binary arithmetic and supports negative numbers.

Excess Notation

A method of representing numbers using a fixed bias added to the actual value, often used in exponent representation in floating point numbers.

Floating-Point Representation

A system for representing real numbers that supports a wide range by using a mantissa and an exponent.

Data Compression

Techniques used to reduce the size of data by removing redundancies, enabling efficient storage and transmission.

Parity Bit

An extra bit added to data to assist in error detection, indicating whether the number of 1s in the data is even or odd.

Hamming Code

An error-correcting code that detects and corrects single-bit errors in data using redundant bits.

Main Memory

The primary storage area in a computer where data is stored temporarily for quick access by the CPU.

Mass Storage

Long-term data storage devices designed to retain large amounts of data even when the computer is turned off.

Example Problems

Example 1

Determine the output of each of the following circuits, assuming that the upper input is 1 and the lower input is 0. What would be the output when upper input is 0 and the lower input is $1 ?$

Example 2

a. What Boolean operation does the circuit compute? b. What Boolean operation does the circuit compute?

Example 3

a. If we were to purchase a flip-flop circuit from an electronic component store, we may find that it has an additional input called flip. When this input changes from a 0 to $1,$ the output flips state (if it was 0 it is now $1 \text { and vice versa }) .$ However, when the flip input changes from 1 to a 0, nothing happens. Even though we may not know the details of the circuitry needed to accomplish this behavior, we could still use this device as an abstract tool in other circuits. Consider the circuitry using two of the following flip-flops. If a pulse were sent on the circuit's input, the bottom flip-flop would change state. However, the second flip-flop would not change, since its input (received from the output of the NOT gate) went from a 1 to a $0 .$ As a result, this circuit would now produce the outputs 0 and 1 A second pulse would flip the state of both flip-flops, producing an output of 1 and 0. What would be the output after a third pulse? After a fourth pulse? b. It is often necessary to coordinate activities of various components within a computer. This is accomplished by connecting a pulsating signal (called a clock) to circuitry similar to part a. Additional gates (as shown) send signals in a coordinated fashion to other connected circuits. On studying this circuit, you should be able to confirm that on the $1^{\text {st }}, 5^{\text {th }}$ $9^{\text {th }} \ldots$ pulses of the clock, a 1 will be sent on output A. On what pulses of the clock will a 1 be sent on output $\mathrm{B}$ ? On what pulses of the clock will a 1 be sent on output $\mathrm{C}$ ? $\mathrm{On}$ which output is a 1 sent on the $4^{\text {th }}$ pulse of the clock?

Example 4

Assume that both of the inputs in the following circuit are $1 .$ Describe what would happen if the upper input were temporarily changed to $0 .$ Describe what would happen if the lower input were temporarily changed to 0. Redraw the circuit using NAND gates.

Example 5

The following table represents the addresses and contents (using hexadecimal notation) of some cells in a machine's main memory. Starting with this memory arrangement, follow the sequence of instructions and record the final contents of each of these memory cells: $\begin{array}{cc}\text { Address } & \text { Contents } \\ 00 & \mathrm{AB} \\ 01 & 53 \\ 02 & \mathrm{D} 6 \\ 03 & 02\end{array}$ Step 1. Move the contents of the cell whose address is 03 to the cell at address 00 Step 2. Move the value 01 into the cell at address 02 Step 3. Move the value stored at address 01 into the cell at address 03

Scroll left
Scroll right

Step-by-Step Explanations

QUESTION

How do you convert a negative decimal number to its two’s complement representation in an 8-bit system (e.g., -5)?

STEP-BY-STEP ANSWER:

Step 1: Represent the positive version of the number (5) in binary: 00000101.
Step 2: Invert the digits (find the one's complement): 11111010.
Step 3: Add 1 to the inverted number: 11111010 + 1 = 11111011.
Final Answer: The two’s complement representation of -5 in an 8-bit system is 11111011.

Two’s Complement

QUESTION

How is a real number like 6.5 represented using a simplified floating-point format?

STEP-BY-STEP ANSWER:

Step 1: Convert the number to binary (6.5 in binary is 110.1).
Step 2: Normalize the binary number so that it has one digit before the binary point (1.101 x 2^2).
Step 3: Identify the mantissa (101) and the exponent (2) to represent the number.
Final Answer: 6.5 is represented as 1.101 x 2^2 in normalized floating-point format.

Floating-Point Representation

QUESTION

How does a Hamming code identify and correct single-bit errors?

STEP-BY-STEP ANSWER:

Step 1: Data bits are arranged with redundant parity bits inserted at specific positions.
Step 2: Each parity bit covers a set of data bits; the arrangement is designed so that any single-bit error will affect a unique combination of parity bits.
Step 3: On receiving the data, parity checks are performed. If parity bits indicate an error pattern, the position of the error is identified.
Step 4: The erroneous bit is flipped to correct the error.
Final Answer: Hamming codes use strategically placed parity bits to detect and correct single-bit errors by identifying the error’s position and flipping the bit.

Hamming Code

Scroll left
Scroll right

Common Mistakes

  • Confusing two’s complement with sign-magnitude representation for negative numbers.
  • Overlooking the role of excess notation in floating-point exponent representation.
  • Failing to recognize the differences between main memory and mass storage in terms of data accessibility and longevity.
  • Neglecting the importance of adding redundant bits for error detection and correction, leading to misunderstandings about error resilience.
  • Assuming that data compression always leads to data loss, rather than understanding the difference between lossless and lossy methods.