Hardware Abstraction

01

What is a Computer?

A computing device is an electronic device for storing and processing data by following instructions given to it in a program. Mobile devices – smart phones and tablets – are general purpose computers. Like desktop and laptop computers, these general purpose computers can run different programs or apps. This contrasts with special purpose computers which can run only a single set program. Examples of special purpose computers include a simple non-programmable calculator, a microwave oven, a smart thermostat, and a car's anti-lock braking system.

Binary Code

Computers understand binary code or machine language. Binary code consists of 0s and 1s. One binary digit is called a bit. A group of eight bits is referred to as a byte. One byte of memory takes about the same amount of memory as a character, such as the letter 't'.

In this unit we want to focus on the binary number system: i.e., using sequences of 0s and 1s to represent numbers. The binary number system is very similar to our decimal number system. But whereas the decimal system uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, to represent numbers, the binary system uses only two digits: 0 and 1.

The reason computers use the binary system is because its two digits, 0 and 1, are easily represented in electronic devices, where the 0 could be represented by "off" and the 1 by "on". Or the 0 could be represented by low voltage and the 1 by high voltage. A bit is the smallest unit of binary information. A bit can be either 0 or 1. So, in one sense, because it uses only 2 digits, whereas the decimal system uses ten digits, the binary number system is even simpler that our decimal system. 

Amazingly, by combining 0s and 1s in various combinations, we can represent all of the data and information that computers use and process. 

Technical Terminology

Software vs Hardware - Video

Software vs Hardware - Slides

D02-Software Vs Hardware

Abstraction In Hardware and Software

Abstraction is an important concept in CS, and justifiably so. In fact, the history of computing can be seen as an advance from very primitive abstractions to very high-level abstractions.

App Inventor is a great example of very high-level abstraction. Consider the Camera component. App Inventor lets you take a photo by using a single Camera.TakePicture block in your app. But think about all of the very low-level operations that have to take place to focus the camera, gather and convert light rays into pixels and then into bits and then into an image file on your device. The App Inventor block hides all of that complexity.

Before There Was Software

To help us get a sense of this march through ever higher levels of abstraction, we're going to imagine ourselves back in the very first days of computing, to the days before there was such a thing as software, when "programming" was a matter of manually inserting instructions and data into the computer, pressing the "run" switch and hoping for the best. There were no operating systems and blocks editors back then -- those abstractions came much later.

In the early days of computing, before there was software, virtually all programmers were women. Women 'computers', as they were called, wrote the first programs on the ENIAC, the first digital computer. But the story of the ENIAC programmers had not been told until just recently. Watch the trailer of a new movie. After watching, discuss with your classmates whether or not programmers used the same or different skills compared to what you're learning in this course.

The ENIAC weighed 30 tons. But in the hardware of the day it could store only 20 10-digit numbers in its accumulators or memory registers. Programs had to be written by hand on paper and once the algorithm was figured out, it would often take days to get the program into the ENIAC by manipulating its switches and cables. Later on, punched cards like the following were used to input programs or a simple addition calculation.

Components

For as long as people have been teaching other people about computers, they always say "A computer consists of the processor, memory, and input/output (I/O) devices."

In the early days of computers, it was easy to point out the huge racks of equipment that contained each of those three components.

These are pictures of a powerful computer from the 1970s. Each of the big racks full of circuitry is about the size of a refrigerator. Today, a much more powerful computer—more speed, more memory—fits inside a cell phone.

Because today's processors and memory are so small, most of what we see is the input/output (I/O) devices, like keyboard, mouse, screens. Input devices include the keyboard, mouse, and microphone. Output devices include the printer, speaker, and (for laptop or desktop computers) the display screen. On phones and tablets, touchscreens are used for both input and output. Disk drives, optical drives (for CDs and DVDs), and the Internet interface are also used for both.

Still Curious?

Here's a cool video made by two Googlers that takes apart a Nexus 5 phone and explains what all the parts are.

Here are some additional resources you might want to look at to learn more about how computer's work: