Chapter 2 The Digital World 1 Digital Data

  • Slides: 35
Download presentation
Chapter 2 The Digital World 1

Chapter 2 The Digital World 1

Digital Data Representation 2

Digital Data Representation 2

Binary Code to Circuit States v. A system of rules that correlates the elements

Binary Code to Circuit States v. A system of rules that correlates the elements of one set with the elements of another is called a code. v Electronic circuits either have electricity flowing through them or they don’t. If we assign one number to each of the two possible circuit states, we might get a code like: 0 = no electricity flow l 1 = electricity flow l 3

Binary Numbering System The digits 0 and 1 make up the binary numbering system.

Binary Numbering System The digits 0 and 1 make up the binary numbering system. The binary numbering system is a base-2 system instead of base-10, like our “normal” numbering system. 4

Binary Code to Circuit States v The “on” and “off” states of each of

Binary Code to Circuit States v The “on” and “off” states of each of the many thousands, even millions, of circuits within a processor are represented by binary digits, or bits. v Since there are only two binary digits (0 and 1), a bit can only have one of two values (0 or 1). v The term digital refers to anything pertaining to bits. v A device that works with data in “bit” form is called a digital device. 5

From Real-World to Binary Code v When people describe the world around them, they

From Real-World to Binary Code v When people describe the world around them, they already use a form of symbolic code - human language. v Human language is comprised of words - which are, in turn, comprised of letter or character symbols. v An individual series of 8 bits used to represent a character is called a byte. 6

ASCII Code v One of the most widely used data coding schemes is the

ASCII Code v One of the most widely used data coding schemes is the American Standard Code for Information Interchange (ASCII). v ASCII code uses a series of either 7 bits (ASCII-7) or 8 bits (ASCII-8). v ASCII is used on microcomputers, minicomputers and digital telecommunications. 7

ASCII Example 8

ASCII Example 8

EBCDIC Code v The coding scheme commonly used by mainframe computer systems is called

EBCDIC Code v The coding scheme commonly used by mainframe computer systems is called Extended Binary Coded Decimal Interchange Code (EBCDIC). v With EBCDIC, each 8 -bit byte is divided into two portions - the zone portion and the digit portion. 9

EBCDIC Example v The bits in both the zone portion and the digit portion

EBCDIC Example v The bits in both the zone portion and the digit portion are assigned numeric values based on the binary number system and form the basis for a logical representation of data. 10

Digitizing Images Digitization is the process of converting black and white or color data

Digitizing Images Digitization is the process of converting black and white or color data into digital information. v A picture is converted into a grid of dots. Each dot is called a pixel, a contraction of the words picture and element. v . . . 11

Pixels n n Different colors or shades of gray can be represented by using

Pixels n n Different colors or shades of gray can be represented by using a number of bits for each pixel. The significant features of all of computer coding schemes is that they are digital. They are based upon, or convertible to, a binary code of bits that can be used to turn individual processor circuits “on” and “off”. 12

Units of Information 13

Units of Information 13

Objective v Differentiate between the basic units of information (bits, bytes, and words) and

Objective v Differentiate between the basic units of information (bits, bytes, and words) and order them by size. 14

How Does the Computer Understand What You Input? v Because digital computers are made

How Does the Computer Understand What You Input? v Because digital computers are made of electronic circuits, q they cannot work directly with characters. Characters can be in the form of alphabetic (letters), numeric (numbers), and other special characters (such as *, $, +, and &), collectively called alphanumeric. q they can only recognize two distinct electrical states ON or OFF. The on and off states are commonly represented with number 1 and 0, respectively. q various combinations of 1 s and 0 s can be entered and stored in a computer to represent all the numbers, letters, and symbols. 15

How Does the Computer Understand What You Input? (continued) v Figure 2. 1 illustrates

How Does the Computer Understand What You Input? (continued) v Figure 2. 1 illustrates how information is represented in a computer by a specific combination of 0 s and 1 s. 16

How Does the Computer Understand What You Input? (continued) “M” 1 0 0 1

How Does the Computer Understand What You Input? (continued) “M” 1 0 0 1 1 0 1 ON OFF ON Figure 2. 1 Representing Information 17

The Basic Units of Information? 18

The Basic Units of Information? 18

Bit The bit or binary digit, is the smallest unit of information that can

Bit The bit or binary digit, is the smallest unit of information that can be used by the computer and is always either a 0 or a 1. v Each bit represents a single on/off state of a computer circuit. v v Computers can not store or retrieve individual bits when transferring information to or from memory. Therefore the computer works with larger elements of information called “bytes” and “words. ” 19

Word Bits are grouped together and handled as a single entity known as a

Word Bits are grouped together and handled as a single entity known as a word. v A computer word can be addressed (either stored in or retrieved from memory) while a bit can not. v Depending on the type of computer used and the size of the word, a word may consist of anywhere from 8 to 64 bits. v Because information used by a computer may be either instructions or data, a computer word may represent either instructions or data. v q q If the word contains data to be processed, it is called a “data word. ” If the word contains an instruction, it is called a “instruction word. ” 20

Byte v Words are divided into smaller subunits called “bytes. ” v. A byte

Byte v Words are divided into smaller subunits called “bytes. ” v. A byte is usually either one-half or one-quarter the size of the computer word, and is typically 8 bits long. v Bytes, like words, contain a fixed number of bits and are treated as a single unit of information. v A byte is a single character of data. v The byte is the smallest unit of information that can be addressed. 21

v Figure 2. 2 illustrates all computer information, whether data or instructions, consists of

v Figure 2. 2 illustrates all computer information, whether data or instructions, consists of bits, bytes, and words. 22

BIT 0 8 -BIT BYTE (1/2 WORD) 0 1 1 1 0 16 -BIT

BIT 0 8 -BIT BYTE (1/2 WORD) 0 1 1 1 0 16 -BIT WORD 0 1 1 0 0 1 Figure 2. 2 Relationship of Bit, Byte, and Word 23

Storage and Retrieval of Information 24

Storage and Retrieval of Information 24

Objectives 1. Explain how information is stored by differentiating among memory address, memory location,

Objectives 1. Explain how information is stored by differentiating among memory address, memory location, and memory contents. 2. Convert memory sizes, expressed in "k", “M”, and “G” notations, into the exact number of words expressed in decimal notation. 25

Memory Structure v Main memory consists of thousands of individual components, or cells, which

Memory Structure v Main memory consists of thousands of individual components, or cells, which are referred to as memory “location. ” v Each location is used to store information that the CPU needs for processing or to store the results of the processing. v An individual memory location can hold only one piece of information at a time. v One location can store only a single instruction word or a single data word. 26

Memory Structure (continued) v If a particular computer uses “bytes, ” then each location

Memory Structure (continued) v If a particular computer uses “bytes, ” then each location will hold only one instruction byte or one data byte. v Every location in main memory is identified by a unique address that has been assigned to it at the time of manufacture. v It is important to remember that this address specifies the location, not the contents of the location. v It is similar to a house address which specifies the location of the house rather than identifying the names of the people who might be living there at the time. 27

Memory Structure (continued) v Memory addresses are numbers that usually begin at 0 and

Memory Structure (continued) v Memory addresses are numbers that usually begin at 0 and progress to the highest number required to identify all of the locations within a specific memory. v Because each location has its own unique address, the CPU can go directly to any location in memory and either store a word or retrieve a previously stored word. v The address of a location can never be changed but the contents of a location can be changed whenever desired. 28

Memory Structure (continued) v Figure 2. 3 illustrates a portion of main memory and

Memory Structure (continued) v Figure 2. 3 illustrates a portion of main memory and indicates the relationship among a memory location, the address of that location, and the contents of that location. 29

Memory Structure (continued) 31 32 ADDRESS 33 ADD LOCATION 34 CONTENTS Figure 2. 3

Memory Structure (continued) 31 32 ADDRESS 33 ADD LOCATION 34 CONTENTS Figure 2. 3 Segment of Main Memory 30

Storage and Retrieving Information v When any memory location is to be used for

Storage and Retrieving Information v When any memory location is to be used for either storing or retrieving information, the CPU must first specify the address of the location that is to be used. This action is referred to as addressing memory. v Once a memory location has been addressed, information can be moved into the specified location for storage. q Whenever new information is stored in a memory location, it replaces (or destroys) the previous contents of that location. 31

Storage and Retrieving Information (continued) v When the CPU wants to retrieve information from

Storage and Retrieving Information (continued) v When the CPU wants to retrieve information from memory, it addresses the memory location and removes the contents. v During retrieval operations, the contents of that location are not destroyed. v During stored operations, the contents of that location are destroyed. 32

Memory Size v The byte is the basic unit for measuring the size of

Memory Size v The byte is the basic unit for measuring the size of the memory. v Computer memories are available in many different sizes. v Memory size refers to the total number of bytes that can be stored in a specific memory. v Because one location can be used to store one byte, memory size also refers to the total number of locations in memory. 33

Memory Size(continued) v Memory size for most computers is measured in Kilobytes (KB) and

Memory Size(continued) v Memory size for most computers is measured in Kilobytes (KB) and Megabytes (MB). K = 210 = 1024 bytes M = 220 = 1, 048, 576 bytes v It is a common practice to round off “K” to 1, 000, “M” to 1, 000. v The memory size of some high-end mainframes and supercomputers are measured in Gigabytes (GB), about one billion bytes, and Terabytes (TB), about one trillion bytes. 34

Memory Size(continued) v GB and TB are used in reference to high-capacity secondary storage.

Memory Size(continued) v GB and TB are used in reference to high-capacity secondary storage. v It is important to remember that each memory location is assigned a unique address. v 32 K memory has approximately 32, 000 locations (addresses). v 32 K memory has actually 32, 786 locations (addresses). 35