Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » Fundamentals of Electrical Engineering I » Introduction to Computer Organization

Navigation

Table of Contents

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • OrangeGrove display tagshide tags

    This collection is included inLens: Florida Orange Grove Textbooks
    By: Florida Orange Grove

    Click the "OrangeGrove" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Rice DSS - Braille display tagshide tags

    This collection is included inLens: Rice University Disability Support Services's Lens
    By: Rice University Disability Support Services

    Comments:

    "Electrical Engineering Digital Processing Systems in Braille."

    Click the "Rice DSS - Braille" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Rice Digital Scholarship display tagshide tags

    This collection is included in aLens by: Digital Scholarship at Rice University

    Click the "Rice Digital Scholarship" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Bookshare

    This collection is included inLens: Bookshare's Lens
    By: Bookshare - A Benetech Initiative

    Comments:

    "Accessible versions of this collection are available at Bookshare. DAISY and BRF provided."

    Click the "Bookshare" link to see all content affiliated with them.

  • Featured Content display tagshide tags

    This collection is included inLens: Connexions Featured Content
    By: Connexions

    Comments:

    "The course focuses on the creation, manipulation, transmission, and reception of information by electronic means. It covers elementary signal theory, time- and frequency-domain analysis, the […]"

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module and collection are included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Introduction to Computer Organization

Module by: Don Johnson. E-mail the author

Summary: Explains how digital systems such as the computer represent numbers. Covers the basics of boolean algebra and binary math.

Computer Architecture

To understand digital signal processing systems, we must understand a little about how computers compute. The modern definition of a computer is an electronic device that performs calculations on data, presenting the results to humans or other computers in a variety of (hopefully useful) ways.

Figure 1: Generic computer hardware organization.
Organization of a Simple Computer
Organization of a Simple Computer (hardware.png)

The generic computer contains input devices (keyboard, mouse, A/D (analog-to-digital) converter, etc.), a computational unit, and output devices (monitors, printers, D/A converters). The computational unit is the computer's heart, and usually consists of a central processing unit (CPU), a memory, and an input/output (I/O) interface. What I/O devices might be present on a given computer vary greatly.

  • A simple computer operates fundamentally in discrete time. Computers are clocked devices, in which computational steps occur periodically according to ticks of a clock. This description belies clock speed: When you say "I have a 1 GHz computer," you mean that your computer takes 1 nanosecond to perform each step. That is incredibly fast! A "step" does not, unfortunately, necessarily mean a computation like an addition; computers break such computations down into several stages, which means that the clock speed need not express the computational speed. Computational speed is expressed in units of millions of instructions/second (Mips). Your 1 GHz computer (clock speed) may have a computational speed of 200 Mips.
  • Computers perform integer (discrete-valued) computations. Computer calculations can be numeric (obeying the laws of arithmetic), logical (obeying the laws of an algebra), or symbolic (obeying any law you like).1 Each computer instruction that performs an elementary numeric calculation --- an addition, a multiplication, or a division --- does so only for integers. The sum or product of two integers is also an integer, but the quotient of two integers is likely to not be an integer. How does a computer deal with numbers that have digits to the right of the decimal point? This problem is addressed by using the so-called floating-point representation of real numbers. At its heart, however, this representation relies on integer-valued computations.

Representing Numbers

Focusing on numbers, all numbers can represented by the positional notation system. 2 The bb-ary positional representation system uses the position of digits ranging from 0 to bb-1 to denote a number. The quantity bb is known as the base of the number system. Mathematically, positional systems represent the positive integer nn as

n=k=0 d k bk  ,   d k 0b1    d k d k 0 b 1 n k 0 d k b k
(1)
and we succinctly express nn in base-bb as n b = d N d N 1 d 0 n b d N d N 1 d 0 . The number 25 in base 10 equals 2×101+5×100 2 10 1 5 10 0 , so that the digits representing this number are d 0 =5 d 0 5 , d 1 =2 d 1 2 , and all other d k d k equal zero. This same number in binary (base 2) equals 11001 ( 1×24+1×23+0×22+0×21+1×20 1 2 4 1 2 3 0 2 2 0 2 1 1 2 0 ) and 19 in hexadecimal (base 16). Fractions between zero and one are represented the same way.
f=k=-1 d k bk  ,   d k 0b1    d k d k 0 b 1 f k -1 d k b k
(2)
All numbers can be represented by their sign, integer and fractional parts. Complex numbers can be thought of as two real numbers that obey special rules to manipulate them.

Humans use base 10, commonly assumed to be due to us having ten fingers. Digital computers use the base 2 or binary number representation, each digit of which is known as a bit (binary digit).

Figure 2: The various ways numbers are represented in binary are illustrated. The number of bytes for the exponent and mantissa components of floating point numbers varies.
Number representations on computers
Number representations on computers (sys29.png)
Here, each bit is represented as a voltage that is either "high" or "low," thereby representing "1" or "0," respectively. To represent signed values, we tack on a special bit—the sign bit—to express the sign. The computer's memory consists of an ordered sequence of bytes, a collection of eight bits. A byte can therefore represent an unsigned number ranging from 0 0 to 255 255. If we take one of the bits and make it the sign bit, we can make the same byte to represent numbers ranging from 128128 to 127127. But a computer cannot represent all possible real numbers. The fault is not with the binary number system; rather having only a finite number of bytes is the problem. While a gigabyte of memory may seem to be a lot, it takes an infinite number of bits to represent π. Since we want to store many numbers in a computer's memory, we are restricted to those that have a finite binary representation. Large integers can be represented by an ordered sequence of bytes. Common lengths, usually expressed in terms of the number of bits, are 16, 32, and 64. Thus, an unsigned 32-bit number can represent integers ranging between 0 and 2321 2 32 1 (4,294,967,295), a number almost big enough to enumerate every human in the world!3

Exercise 1

For both 32-bit and 64-bit integer representations, what are the largest numbers that can be represented if a sign bit must also be included.

Solution

For bb-bit signed integers, the largest number is 2b11 2 b 1 1 . For b=32 b 32 , we have 2,147,483,647 and for b=64 b 64 , we have 9,223,372,036,854,775,807 or about 9.2×1018 9.218.

While this system represents integers well, how about numbers having nonzero digits to the right of the decimal point? In other words, how are numbers that have fractional parts represented? For such numbers, the binary representation system is used, but with a little more complexity. The floating-point system uses a number of bytes - typically 4 or 8 - to represent the number, but with one byte (sometimes two bytes) reserved to represent the exponent ee of a power-of-two multiplier for the number - the mantissa mm - expressed by the remaining bytes.

x=m2e x m 2e
(3)
The mantissa is usually taken to be a binary fraction having a magnitude in the range 12 1 1 2 1 , which means that the binary representation is such that d -1 =1 d -1 1 . 4 The number zero is an exception to this rule, and it is the only floating point number having a zero fraction. The sign of the mantissa represents the sign of the number and the exponent can be a signed integer.

A computer's representation of integers is either perfect or only approximate, the latter situation occurring when the integer exceeds the range of numbers that a limited set of bytes can represent. Floating point representations have similar representation problems: if the number xx can be multiplied/divided by enough powers of two to yield a fraction lying between 1/2 and 1 that has a finite binary-fraction representation, the number is represented exactly in floating point. Otherwise, we can only represent the number approximately, not catastrophically in error as with integers. For example, the number 2.5 equals 0.625×22 0.625 22 , the fractional part of which has an exact binary representation. 5 However, the number 2.62.6 does not have an exact binary representation, and only be represented approximately in floating point. In single precision floating point numbers, which require 32 bits (one byte for the exponent and the remaining 24 bits for the mantissa), the number 2.6 will be represented as 2.600000079...2.600000079.... Note that this approximation has a much longer decimal expansion. This level of accuracy may not suffice in numerical calculations. Double precision floating point numbers consume 8 bytes, and quadruple precision 16 bytes. The more bits used in the mantissa, the greater the accuracy. This increasing accuracy means that more numbers can be represented exactly, but there are always some that cannot. Such inexact numbers have an infinite binary representation.6 Realizing that real numbers can be only represented approximately is quite important, and underlies the entire field of numerical analysis, which seeks to predict the numerical accuracy of any computation.

Exercise 2

What are the largest and smallest numbers that can be represented in 32-bit floating point? in 64-bit floating point that has sixteen bits allocated to the exponent? Note that both exponent and mantissa require a sign bit.

Solution

In floating point, the number of bits in the exponent determines the largest and smallest representable numbers. For 32-bit floating point, the largest (smallest) numbers are 2±127=1.7×1038 2 ± 127 1.7 10 38 ( 5.9×10-39 5.9 10 -39 ). For 64-bit floating point, the largest number is about 109863 10 9863 .

So long as the integers aren't too large, they can be represented exactly in a computer using the binary positional notation. Electronic circuits that make up the physical computer can add and subtract integers without error. (This statement isn't quite true; when does addition cause problems?)

Computer Arithmetic and Logic

The binary addition and multiplication tables are

( 0+0=0 0+1=1 1+1=10 1+0=1 0×0=0 0×1=0 1×1=1 1×0=0 ) 0 0 0 0 1 1 1 1 10 1 0 1 0 0 0 0 1 0 1 1 1 1 0 0
(4)

Note that if carries are ignored,7 subtraction of two single-digit binary numbers yields the same bit as addition. Computers use high and low voltage values to express a bit, and an array of such voltages express numbers akin to positional notation. Logic circuits perform arithmetic operations.

Exercise 3

Add twenty-five and seven in base 2. Note the carries that might occur. Why is the result "nice"?

Solution

25=110112 25 11011 and 7=1112 7 111 . We find that 110012+1112=1000002=32 11001 111 100000 32 .

The variables of logic indicate truth or falsehood. AB AB , the AND of AA and BB, represents a statement that both AA and BB must be true for the statement to be true. You use this kind of statement to tell search engines that you want to restrict hits to cases where both of the events AA and BB occur. AB AB , the OR of AA and BB, yields a value of truth if either is true. Note that if we represent truth by a "1" and falsehood by a "0," binary multiplication corresponds to AND and addition (ignoring carries) to XOR. XOR, the exclusive or operator, equals the union of AB AB and AB AB. The Irish mathematician George Boole discovered this equivalence in the mid-nineteenth century. It laid the foundation for what we now call Boolean algebra, which expresses as equations logical statements. More importantly, any computer using base-2 representations and arithmetic can also easily evaluate logical statements. This fact makes an integer-based computational device much more powerful than might be apparent.

Footnotes

  1. An example of a symbolic computation is sorting a list of names.
  2. Alternative number representation systems exist. For example, we could use stick figure counting or Roman numerals. These were useful in ancient times, but very limiting when it comes to arithmetic calculations: ever tried to divide two Roman numerals?
  3. You need one more bit to do that.
  4. In some computers, this normalization is taken to an extreme: the leading binary digit is not explicitly expressed, providing an extra bit to represent the mantissa a little more accurately. This convention is known as the hidden-ones notation.
  5. See if you can find this representation.
  6. Note that there will always be numbers that have an infinite representation in any chosen positional system. The choice of base defines which do and which don't. If you were thinking that base 10 numbers would solve this inaccuracy, note that 1/3=0.333333.... 13 0.333333.... has an infinite representation in decimal (and binary for that matter), but has finite representation in base 3.
  7. A carry means that a computation performed at a given position affects other positions as well. Here, 1+1=10 1 1 10 is an example of a computation that involves a carry.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks