CHAPTER 1

Introduction to Computers and Programming

Chapter Objectives

By the end of the chapter, readers will be able to:

images  Define what is meant by a modern day computer.

images  Understand some of the key milestones in the evolution of computers.

images  Explain the major components of a computer.

images  Explain what is meant by software.

images  Differentiate between an operating system and an application program.

images  Discuss the differences and similarities among hardware, software, and embedded systems.

images  Explain what is meant by a programming paradigm.

images  Discuss significant historic developments associated with both C and C++.

images  Explain the components of data hierarchy.

images  Discuss the issues surrounding numbering systems.

Introduction

This chapter is designed to introduce you to the exciting and ever-changing world of computers and computer programming. We begin our journey by developing a working definition of computers. Next we briefly examine some of the early milestones in computing history, and then study the various components that make up computers, beginning with hardware.

Once the basic premise behind computer hardware has been introduced, we focus our attention on computer software. Our discussion not only reviews the major categories of software but also introduces two of the more popular programming languages: C and C++. Other issues revolving around computers—such as numbering systems, data hierarchy, and programming paradigms—are discussed.

Be aware that we are providing only a brief introduction to the various topics presented, although some of the material will be discussed in greater detail in the remainder of the text. As you read the chapter, we encourage you to start your browser and further research any area of interest.

1.1 Overview of Computers and Programming

As you are well aware, computers have had a huge influence on almost all phases of our lives. They are everywhere, and additional uses for computers continue to emerge. You see them in classrooms, homes, cars, cell phones, gaming consoles, televisions, and MP3 players. However, before continuing with the remainder of the text, it is important to establish a common understanding of computer terminology.

For our purposes, we refer to a computer as an electronically powered physical device that has the ability to store, manipulate, and access data. In addition, our definition includes the fact that a computer can be designed to carry out or follow a specific set of instructions called a program. Programs are often referred to as computer software.

A computer system is composed of both hardware and software. The physical components, hardware, work with the software installed on the computer to accomplish the tasks the user desires. It is necessary to have both hardware and software working together to enable all of the capabilities to which we have become accustomed. These terms and more will be discussed in greater detail in the remainder of the chapter.

1.2 Historical Developments

Using devices to help in performing computations has had a long history. Many scholars date the abacus, with its beads and wires, as being invented by the Chinese thousands of years ago (Figure 1.2.1).

Another step in the computing evolution was due in large part to English mathematician Charles Babbage, (1791-1871) often considered the father of computing. During his lifetime Babbage developed detailed plans for a number of machines. The design for one of his machines, the analytical engine, contained many of the fundamental features that still exist in today's computers, including the concept of a stored program. Babbage's friend, Ada Lovelace, created a program based on the design of his analytical engine, and is therefore thought of as the first programmer. The influence of both of these remarkable individuals is still being felt today.

Some of the earliest electronic computers were developed in the 1940s. These computers were extremely large and heavy, and it was not uncommon for them to be so big that they would take up an entire room. One of the first electronic computers, the ENIAC, was said to weigh approximately 30 tons (Figure 1.2.2). ENIAC is an acronym for electronic numerical integrator and computer and had most of its programming done by a group of six women. From that point, a wide variety of hardware advances quickly began to emerge.

One of those advances centered on the development of the integrated circuit, or IC. An IC is a chip that can contain a large number of different components, such as resistors, transistors, and capacitors. ICs, sometimes referred to as chips, are in a continual state of evolution and enhancement.

images

Figure 1.2.1 Abacus. © Lim ChewHow/Shutterstock, Inc.

images

Figure 1.2.2 ENIAC. Courtesy of U.S. Army

Following the development of the IC was the introduction of the microprocessor. A microprocessor is an IC containing components that actually execute a program. The microprocessor, or processor, often has a component called a CPU.

The CPU, central processing unit, acts as the brains of the computer. It is here where the actual program or set of instructions that tells the computer what to do is interpreted and processed.

The microprocessor serves as the major component within today's microcomputers, such as a personal computer (PC), and is responsible for directing and managing many of the computer's functions. We will have more to say about the CPU in the next section.

In the late 1970s, the microcomputer became available to a huge segment of the population. By the end of the 1980s, companies like Apple and its competitor IBM were selling a huge number of PCs to a wide range of customers.

Today we see a continuing trend, in which processors are becoming smaller, faster, more powerful, and less expensive. Their use in an ever-widening range of devices continues to expand into such areas as health-related products, consumer goods, and industrial applications.

Section 1.2 Exercises

1.  Using the Internet, find and discuss two more significant advances or events in the evolution of computers.

2.  Using the Internet, find three people who have had a major influence on computers or programming.

1.3 Computer Hardware

Now that we have briefly traced some of the historical developments related to computers, it's time to explore several of the individual hardware components that make up a computer system, especially as they relate to the PC. The term computer hardware encompasses objects that can be felt or seen. Examples include disk drives, keyboards, memory, printers, chips, and monitors. To aid in our discussion of computer hardware, we will group the various hardware pieces into some helpful categories.

1.3.1 Input and Output (I/O) Devices

The first category of hardware devices we'll examine relates to input and output. Input devices provide a mechanism with which the user communicates with the computer. In some ways input devices are similar to our individual senses. For example, it is through our sense of hearing that we listen to the instructions or directions people provide us. Likewise, through our eyes we have the ability to gather data or input about a particular situation or event. With computers, input equipment often includes such devices as the keyboard and the mouse. It is through these devices, or interfaces, that we send information to the computer system. Today we continue to see a number of innovative methods for inputting data. Some relatively recent examples of creative input devices include touch screens, light pens, graphic tablets, wired gloves, and the Wii remote control.

Output devices are used to communicate information or processed data from the computer to a user. Examples of popular output devices include printers, speakers, and video displays.

1.3.2 Random-Access Memory (RAM)

Random-access memory (RAM) is memory within a computer that is used for holding the program and any information needed to perform the necessary processing. It is often referred to as short-term memory because the data contained within RAM will be lost when the computer is shut off or loses power. RAM tends to be very fast and is considered to be the computer's main memory.

1.3.3 Central Processing Unit (CPU)

As noted, the CPU serves as the brains of the computer. Its main function is to interpret and execute the instructions contained within the software it is currently running. In today's PCs, the CPU is contained entirely on one individual integrated circuit and is commonly referred to as a microprocessor. Three core components of the CPU are the arithmetic logic unit, the control unit, and the registers.

The arithmetic logic unit (ALU) performs the arithmetic computations and the logical operations. The arithmetic computations include such activities as addition and subtraction, while the logical operations involve such activities as evaluating two values to check for equality.

The control unit (CU) is responsible for the actual execution of instructions and also controls when instructions are executed. In other words, the CU tells the ALU what to do and when to do it.

Registers are unique, high-speed sections of memory within the CPU. Their purpose is to hold or store the data that is being operated on.

While the complexity and speed at which CPUs are able to perform various operations and functions continue to increase, the size requirements continue to decrease. As a result, we see the embedding of these microprocessors into a wide variety of devices, such as cell phones, cars, personal digital assistants (PDAs), MP3 players, and video-game consoles.

1.3.4 Storage Devices

The next category of computer hardware involves the devices available for storing data. This type of equipment includes hard drives, USB flash drives, and CD-ROM drives.

One of the more common methods for storing data is on a disk. The three main categories of disk-based storage are hard drives; the once popular removable floppy disks; and optical disks, such as CD-ROMs and DVDs.

A hard disk is an excellent form of media for holding your data, the operating system, and application programs. Data and programs can be easily and quickly written, retrieved, modified, and deleted. Most hard drives are physically fixed within your computer. The capacity of today's hard drives is often referenced in terms of gigabytes. When used in relation to a drive, a gigabyte (GB) indicates that the drive can store roughly one billion bytes of information. With the evolution of computer technology, the capacity of disk drives increases while their cost decreases. Today it is common to see PCs and laptops with hard disks containing storage space of anywhere from 80 to 500 GB.

A floppy disk is another form of media that can be used to store information. Floppy disks are made up of a flexible piece of material containing a magnetic recording surface that can store data. Like hard disks, floppy disks are a form of nonvolatile storage, meaning they retain information even when the computer is turned off. However, unlike hard disks, floppy disks are easily transportable because of their relatively small size. While “gigabytes” is often used in referring to the size of today's hard drives, the capacity of the 3.5 floppy is cited in megabytes (MB). In relation to storage capacities, a megabyte represents approximately 1,000,000 bytes. The capacity of the 3.5 floppy disk is approximately 1.44 MB, or 1,474,000 bytes. While very popular up until a few years ago, floppy disks are currently being replaced by higher-capacity flash drives.

USB flash drives are another form of nonvolatile storage. These extremely popular devices, sometimes referred to as pen or thumb drives, are made up of a relatively small circuit board encased in a protective plastic housing (Figure 1.3.1).

images

Figure 1.3.1 USB Flash Drive. © Alex Kotlov/ShutterStock, Inc.

These compact and highly portable drives are easily connectable to your PC via a USB port. USB (universal serial bus) is a standard interface used by a number of hardware devices to allow them to be easily connected to a PC. In addition to being able to read and write data faster than a floppy disk, flash drives have the ability to hold much more data. Most USB drives today have capacities ranging from 64 MB to as much as 4 GB.

The CD-ROM (compact disc read-only memory) is another popular form of nonvolatile, highly portable computer storage. These optical disks are made out of a thin plastic material and use a laser contained within the CD-ROM drive to read the information off the disk's surface. They look exactly like audio CDs and work well for storing large amounts of data. The standard capacity of these disks is usually between 650 and 700 MB of data.

To be able to record information to an optical CD requires either a CD-R or a CD-RW drive. A CD-R (compact disc-recordable) allows the user to write data to the disk only one time but to read the information as often as desired. Likewise, a CD-RW (compact disc-rewritable) provides the ability to read and rewrite information to the disk. The capacity of both CD-R and CD-RW disks is also about 650 to 700 MB.

The final storage medium to note is the DVD (digital versatile disc). These optical disks are the same size as regular CDs. However, because they have the capacity to store more than six times the amount of information of a CD, they tend to work well for holding things like movies, music, and large volumes of data. The standard single-sided DVD holds 4.7 GB of data, while the double-sided DVD holds 9.4 GB of data.

As you can see, there are a wide range of options available for storing data. The best choice depends on how much room you need, how fast it needs to be, and how much money you want to spend. No doubt in the future we will continue to see impressive developments in this area.

1.3.5 Motherboard

The motherboard contains the circuits necessary to connect all of the various components together. For example, the motherboard has a special CPU slot where the central processing unit simply plugs in. Likewise, there are areas on the board for plugging in additional memory or cards for controlling I/O devices such as monitors or printers. While the CPU is often considered the brains of your PC or laptop, the motherboard is sometimes referred to as its heart because of the key role it plays.

Section 1.3 Exercise

1.  What is the best general-purpose computer you can get for $1,000? Look at prefabricated computers as well as those you build yourself.

1.4 Computer Software

Computer software is responsible for getting the computer hardware to do something. Once we turn on our PCs, the software will be loaded into the computer's memory and will start the execution process.

A program consists of detailed instructions written in a specific programming language that actually directs the activities of the computer. This special language must be used so that the computer can understand exactly what the programmer is trying to accomplish.

Programmers, or software developers, are proficient in one or more programming languages. Their job usually revolves around writing, testing, implementing, and maintaining a variety of software programs. Many people credit Ada Lovelace as being the first programmer for her work with Charles Babbage in the 1840s. The United States Department of Defense named its latest and still widely used programming language after Ada in the 1980s.

In our experience, successful computer programmers are good problem solvers who can meet deadlines and enjoy being part of a team. Unlike the traditional stereotype often portrayed in the film industry, programmers need to work well with others and have strong communication skills. In addition, it is often helpful for individuals who are not planning on becoming software developers to take a programming course or two to help broaden their appreciation and understanding of computer software. Fields such as health informatics, finance, systems analysis, web development, information technology, computer security, and network administration rely heavily on computer software.

For our purposes, we will classify software into two distinct types: application software and system software. While the thrust of this text is on writing application software, both categories of software are briefly examined in the following sections.

1.4.1 Application Software

Application software is an extremely broad area of software development and is targeted toward users. Application software can be found in computer games, word processors, spreadsheets, inventory control, grade management, MP3 players, email, and chat programs. An example of an application program that you will soon become familiar with is Microsoft's Visual Studio, an application designed to develop software.

For these and other application programs to run on your PC, you must have an operating system. An operating system is really not an example of application software but falls under the category of system software.

1.4.2 System Software

System software is designed to manage the various hardware components of a computer and to coordinate the loading and execution of application programs. While there are a number of types of system software applications, the most important example is the operating system (OS).

Every PC has an operating system that plays a crucial role in running the computer. It is responsible for managing various tasks, such as preparing the computer when the machine is turned on, dealing with various input requests from such devices as the keyboard and the mouse, managing output requests to the display or printers, and managing the overall storage system.

The OS also provides a crucial interface between the computer hardware and the user. It is through the operating system that the user is able to access the various hardware components, such as the disk drive, along with the related file system, which is also managed by the OS. In addition, the operating system is responsible for such activities as scheduling tasks that have been assigned to it and managing the loading and execution of an almost endless range of application programs. Operating systems have continued to expand, and most now include significant components related to such areas as security and networking. Also, most companies that produce operating systems continually strive to provide consumers with a graphical user interface (GUI) designed to make the computer system easier to use, manage, and learn.

Some of the more popular operating systems in use today include Windows XP, Windows Vista, UNIX (with its many variations), and Mac OS X. Although most individuals will run only one operating system, they are likely to have a wide variety of applications.

In addition to the operating system itself, there are some utility-type programs that can be used to help manage and control various hardware resources. Examples include file managers and communication-related software.

Section 1.4 Exercises

1.  List three operating systems besides the ones mentioned in this chapter.

2.  List five applications found on your computer.

1.5 Embedded Systems

Is your watch an example of a PC? Isn't it made up of both computer hardware and software? How about the thermostat in your house or apartment? Well, in reality, these products are more likely to fall into the ever-growing area of embedded systems. Unlike your PC, which is designed to be a general-purpose device, embedded systems are designed to perform only one or a limited number of tasks. Most embedded systems include both hardware and software together and can be placed collectively on a single microprocessor. The computer software designed and written specifically for use in an embedded system is often referred to as firmware. Since the software is actually located on a chip, it is no longer volatile and thus performs only predefined tasks, unlike a general-purpose desktop computer.

Embedded systems can be found in such products as MP3 players, medical equipment, kitchen appliances, games, vending machines, automobiles, cell phones, and cameras. Clearly the market for embedded systems will continue to grow in the years ahead.

Section 1.5 Exercise

1.  Explain the differences between hardware, software, and embedded systems. Give examples of each.

1.6 Programming Paradigms

When examining programming-related problems and the choices that might be available for designing and structuring a specific solution, software developers often have a number of methods available. These different approaches for visualizing a problem's solution or an overall project structure are referred to as programming paradigms.

Within this text we begin developing programs based on the procedural programming paradigm. The procedural programming paradigm focuses on breaking down a particular programming problem into various pieces, subprograms, or routines. Each of these individual components performs a specific function and is executed as needed. C and Pascal are both examples of languages that adhere to the procedural programming paradigm. Some languages, like C++, actually fall into more than one particular programming paradigm.

Another paradigm discussed within the text is object-oriented programming (OOP). In the OOP paradigm, the central component is considered an object. Examples of objects surround us in our daily lives. Things like this textbook, a dog, a person, a radio, and your computer are all examples of objects. In this paradigm the focus is on the objects and their relationships and interactions. The first OOP language was called Smalltalk. Today languages such as C++, Java, C# (pronounced “C-sharp”), and Visual Basic all support the OOP paradigm. This doesn't necessarily mean that all programs written with these languages are object-oriented, it just means that they are more capable of creating object-oriented programs.

The final programming paradigm we look at is functional programming. This paradigm has its roots in mathematics and centers on the program being made up of a collection of mathematical like functions. A good example of a functional programming language is Lisp. This is probably the least used paradigm.

Section 1.6 Exercise

1.  List three examples of programming languages for each of the three paradigms discussed. (Don't list any of the languages already mentioned in the section.)

1.7 Programming Languages

Computer software is made up of very detailed instructions written in a specific programming language designed to tell the computer how to perform an exact task. As noted, a programming language is simply a language designed by people to direct or control the computer. Unlike the language we use in our daily lives, programming languages must be very exact in their meaning because the computer will only do what it has been told. It will not make any assumptions or guesses about what the programmer might have meant by a particular statement that it does not recognize.

While hundreds of programming languages have been created, there are a relatively small number that have become popular and widely used over time. In the past, some of those popular languages included COBOL, FOR-TRAN, C, BASIC, and Pascal. Today, the most widely used languages include Java, C, C++, Visual Basic, Python, Ada, and C#. Each of these languages has its own strengths and weaknesses. The best language to use for a particular application is usually based on the individual software problem being addressed.

Once introduced, most popular programming languages evolve over time. For example, C++ continues to be reviewed by a standardization committee and is updated to reflect new needs or requirements every few years. Likewise C#, introduced only a few years ago by Microsoft, has already been updated to include new features and additional functionality.

Within this text our emphasis will be on C++, along with an optional section in most chapters showing some comparable C syntax. Given that C++ has its roots in C, we briefly review the history of both languages in the following sections.

1.7.1 The C Programming Language

The programming language C was developed between 1969 and 1973 by Dennis Ritchie (Figure 1.7.1). Ritchie, who was working at Bell Telephone Labs, developed the language to be used in parallel with the development of the UNIX operating system. It was called C because a number of the language's characteristics came from an earlier language called B.

Although originally targeted toward the UNIX operating system, the use of C, commonly used in writing application software, has spread to many other operating systems as well, making C a highly portable language.

C became a widely used language and is still used today, especially in the area of systems programming. In addition, because it has the power to access hardware relatively easily, it continues to be widely used in developing embedded systems. While some people still write traditional user-based applications in C, most programmers have found that languages like C++ are better designed for this particular purpose.

 

 

Content removed due to copyright restrictions

 

Figure 1.7.1

Unlike Pascal, which was developed by a college professor named Niklaus Wirth to teach programming to students, both C and C++ were developed for professional programmers, making them extremely powerful and capable of providing the programmer with the tools to do exactly what he or she wants—even if it is wrong or causes a problem. As a result, you will sometimes see places within both languages that allow you to get into trouble rather easily and perhaps without warning. Within the text we try to make you aware of these potentially dangerous areas.

1.7.2 The C++ Programming Language

In the late 1970s another individual from Bell Labs, Bjarne Stroustrup, augmented C to create a new programming language (Figure 1.7.2). Stroustrup called the first version of the language C with Classes, but after internal use of the language at AT&T in 1983, the name was changed to C++.

Often it is helpful to think of C++ as having two main characteristics or advantages over C:

1.  C++ offers an easier-to-use and enhanced version of C. For example, the syntax for reading data in C++ is considerably easier to use than that for C. Many of the additional language features that help make C++ “a better C” are discussed throughout the remainder of the text.

 

 

Content removed due to copyright restrictions

 

Figure 1.7.2

2.  C++ facilitates object-oriented programming by including classes. In addition, it provides excellent support for powerful object-oriented activities such as inheritance and polymorphism.

Similar to other popular programming languages, C++ has been standardized by an international organization. The current version was last revised in 2003, and a new standard is expected to be published in 2009.

Today C++ continues to be the language of choice for a variety of applications because of the power and functionality it offers. While there are other programming languages that are easier to learn, being taught C++ as your first programming language will provide you with a strong programming background.

Section 1.7 Exercise

1.  Find and bookmark Bjarne Stroustrup's website.

1.8 Data Hierarchy

Data hierarchy is a way of grouping data or information. We commonly think of data hierarchy as consisting of bits, bytes, fields, records, and files.

The smallest piece of data to examine is a bit. In the data hierarchy a bit, or binary digit, can hold either 0 or 1. A bit is the elementary unit of storage found in digital computers. Similar to a light switch found in your dorm room or home, a bit is either on, represented by a 1, or off, denoted by a 0. Typically, a grouping of eight bits is called a byte.

Today, by far the most common size for an individual byte is eight bits. The term “byte” is often used to refer to the amount of computer memory needed to represent or hold one character.

A collection of related bytes is referred to as a field. A field holds all of the characters or data for a specific piece of information. For example, to hold the first and last name of a student, along with their student ID number, we could create three separate fields.

A group of related fields is called a record. To hold the information for 30 students, we would have a set of 30 records. Each record contains a first name field, a last name field, and an ID number field.

The individual records for each of the 30 students in a specific section of a programming course represents a file. A data file is simply a group of related records physically stored on a disk or some other storage media.

One final piece that can be added to the data hierarchy view is a database. In our example, we might have a separate file for each particular section of each of the classes on campus, a file containing a record for each of the faculty members on campus, a separate file listing all the courses offered in a particular term, and so on. Because managing all of these separate files becomes unwieldy, a database can be used to manage the data. A database management system (DBMS) provides tools that assist in handling the maintenance of all of the data.

Throughout the remainder of the text, many of the terms just introduced will be reviewed and expanded on. Having an understanding of the hierarchy will serve you well in helping to visualize how data can be arranged and referenced.

Section 1.8 Exercises

1.  What are two common database management systems?

2.  Using the Internet, what is one-half of a byte called?

1.9 Numbering Systems

Ever since we were old enough to count we have been using a numbering system. Humans typically count using the decimal numbering system. The decimal system uses 10 different digits, 0-9, and is therefore considered a “base 10” numbering system. Computers, however, only know two things: on and off. Therefore, computers need numbering systems that work well with those two states.

The three common numbering systems for computers are binary (base 2), octal (base 8), and hexadecimal (base 16). Notice that 8 and 16 are both powers of two and are therefore very compatible with binary systems. Even though it may be intimidating to learn new numbering systems, the process isn't any different from the one we already know except for the digits used. The following sections explain how to count in different numbering systems, how to convert to base 10 from some other base, and how to convert from base 10 to a different base.

1.9.1 Counting

Counting in base 10 is so commonplace for us that we often no longer think about the mechanics of the process. However, if the process is broken down into its simplest form, we can extend the same procedure to other bases.

In base 10, we start at zero and increment that single digit until we reach nine. At that point the digit to the left of that digit is then incremented. The least significant digit is then reset to zero. This process is easily understood by examining an automobile's odometer. Figure 1.9.1 demonstrates this process.

images

Figure 1.9.1 Counting mechanics for base 10

images

Figure 1.9.2 Counting mechanics for a binary numbering system

images

Figure 1.9.3 Counting in hexadecimal

Notice from Figure 1.9.1 that the value of the largest digit is one less than the base. Therefore, in a base 10 numbering system the largest digit is a nine, whereas in a binary numbering system the largest digit is a one. The nice thing about this process is that it can be applied to any base. Figure 1.9.2 shows an example of counting in binary.

The only anomaly to this method is any base greater than 10. The reason for this difference is that there are only 10 numbers we can use for digits. Hexadecimal, base 16, requires six more digits. The additional digits come from the English alphabet. The letter A is used to denote a value of 10; B is used for 11; C for 12, and so on. Figure 1.9.3 shows how to count in hexadecimal.

The boxes with 009 and 00A in Figure 1.9.3 show the transition from a numeric digit to a character. The boxes with 00F and 010 demonstrate the process of adding a second digit to the number. Notice that the least significant digit becomes zero while the second digit is incremented to a one. This is the same process that we use for a base 10 numbering system.

Extending the concept shown in Figure 1.9.3, it becomes apparent that there are a variety of other bases that could be created by using the remaining letters in the alphabet. Although binary, octal, decimal, and hexadecimal are the four most common bases, other bases have been used. In 1993 Telegrafix created RIPscript, a graphics protocol used to send drawing commands to a remote computer via what they called a meganum—a base 36 number, which used digits 0-9 and letters A-Z.

1.9.2 Converting from a Base to Base 10

The conversion from any base to base 10 is a fairly simple process. The first step is to label the digits with their position, starting from the least significant digit. The number shown and labeled in Figure 1.9.4 is assumed to be a hexadecimal number (C3A).

The next step is to multiply the value of each digit with the current base, raised to the position of that digit. Any non-number digit must be converted to its base 10 value. This process is shown in Figure 1.9.5.

The last step is to add those values together to get the result in base 10. This step is shown in Figure 1.9.6.

Notice that in Figure 1.9.6 the subscript number after the result designates the base of that number. Although this example used a hexadecimal value, the same process will work with any base.

1.9.3 Converting from Base 10 to a Different Base

Since we used multiplication to determine the value of a digit, it makes sense that we will need to use division to convert a base 10 number to some other base. The process involves dividing the base 10 number by the target base. The remainder of the division operation becomes the least significant digit in the result. If the remainder is greater than or equal to 10, this value is translated to its corresponding letter. This process continues using the quotient from the previous step until the quotient becomes zero. This process is shown in Figure 1.9.7, using the base 10 number determined in Figure 1.9.6. The target base will be 16 to prove that the process produces the correct hexadecimal value.

images

Figure 1.9.4 Step 1: Labeling the digits

images

Figure 1.9.5 Step 2: Determining digit value

images

Figure 1.9.6 Step 3: Determining the result

images

Figure 1.9.7 Converting from base 10 to hexadecimal

Converting the values to their corresponding hexadecimal digits results in C3A16, the original value we started with. Similar to the process of converting to base 10, this process also works with any base.

Section 1.9 Exercises

1.  Using the octal numbering system, list the first 20 numbers.

2.  Convert each of the following numbers to base 10.

a. 1238

b. 101010102

c. FAB416

d. ZZTOP36

3.  Convert 119910 to each of the following bases.

a. binary

b. octal

c. hexadecimal

d. base 5

e. base 36

1.10 SUMMARY

This chapter began by introducing a number of fundamental terms and by examining a few of the early historical developments in computers. While exploring some of the major developments, we also presented a number of important events and individuals, including the father of computing, Charles Babbage.

Next we looked at some of the key hardware components that make up a PC. These include I/O devices, such as keyboards and monitors, as well as storage devices, such as flash drives and hard disks. In addition, we discussed the brains of the system—the central processing unit and RAM. Once we covered the key hardware components, the idea of a motherboard was introduced as a way to connect the various pieces together.

After investigating the functionality of computer hardware, our focus changed to software. Even though this text is targeted toward writing application software, we discussed the role that system software plays within a computer system. We also briefly explored embedded systems and noted how most embedded systems today are made by combining both hardware and software in one device.

We introduced the concept of programming paradigms, which help programmers develop solutions to various software problems. After presenting a few of the paradigms, we directed our attention to exploring the history and developments associated with two individual programming languages: C and C++.

Next we presented the data hierarchy, to show one way programmers and software developers can group related data. The last topic covered the concept of numbering systems and explained how numbers can be converted from one base to another.

Now that some of the key historical developments and fundamental aspects associated with computer systems have been presented, you are ready to move forward into the rest of the text. While the major focus will be centered on developing software, you will no doubt find many of the terms and concepts presented here helpful.

1.11 Answers to Selected Chapter Exercises

Section 1.5

1.  Hardware is the physical equipment used within a computer system. Examples include the monitor, keyboard, hard disk, and CPU.

Software is the set of detailed instructions that tells the computer what to do. Examples include the OS, solitaire, an email application, and Visual Studio.

 An embedded system is designed to perform one or just a few tasks and contains both the hardware and the software. Examples include the chip in an MP3 player or a cell phone.

Section 1.8

1.  SQL Server, Sybase, DB2, and Oracle

2.  Nyble

Section 1.9

1.  0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23

2.  

a. 83

b. 170

c. 64,180

d. 60, 457, 993

3.  

a. 10010101111

b. 2257

c. 4AF

d. 14244

e. XB

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.116.51