How computers work
Hardware and Software
(lively music) (women laughing) - Hi, my name's Erica Gomez and I'm an engineering manager at Amazon.com. One of the best things about working in tech and at Amazon in particular is that I get to bring my dog with me to work every day. My job is to help make sure software gets out the door and her job is to nap under my desk and snore very loudly. - My name is Jerome Holman and I'm a program manager on Team Xbox, And I have a really fun job. Basically bringing the hardware and the software together to give you all the games that you love on your Xbox. Oh. (laughing) - When you look inside a computing device you see a bunch of circuits, chips, wires, speakers, plugs, and all sorts of other stuff. This is the hardware. But what you don't see is the software. Software is all of the computer programs, or code, running on this machine. Software can be anything from apps and games to webpages and data science software that me and my teams use at Amazon to understand how customers behave. But how do the hardware and the software interact with one another? Lets start at looking at a computer's central processing unit, or CPU. - The CPU is the master chip that controls all the other parts of the computer. A CPU needs to do different things, so inside it has smaller, simpler parts that handle specific tasks. It has circuits to do simple math and logic, it has other circuits to send and receive information to and from different parts of the computer. The real magic of the CPU is how it knows which circuits to use and when to use them. - [Erica] The CPU receives simple commands that tell it which circuit to use to do a specific job. For example, and add command tells the CPU to use its adder circuit to calculate a new number. And then the store command tells the CPU to use a different circuit to save that result into memory. Just like numbers, all of these simple commands can be represented in binary ones and zeros, or on and off electrical signals. The binary commands are stored in memory and the CPU fetches and executes them in sequence one after the other. This sequence of commands is in fact the very simple computer program. - Binary code is the most basic form of software and it controls all the hardware of a computer. These days nobody writes software in binary, it would take forever. Today, the software we write looks more like this, or this, or even this. Programming languages like these let you type in commands in something that looks a lot like english. To draw a rectangle on the screen you just need a single command. This high level command is converted into hundreds or thousands of simpler binary commands that the CPU understands. - Software tells the CPU what to do, but when you're listening to music and browsing the web and chatting with a friend, your computer is running multiple pieces of software all at once. So how do all of these programs get on the computer in the first place, and how can the CPU run them all at once? To find out we'll have to take a look at the operating system. - The operating system of a computer is the master program that manages how software gets to use the hardware of the computer. For example, I helped create the Windows operating system that runs on most personal computers. The operating system is a program with special abilities that let it control the other software on the computer. It lets you install new programs by loading them into your computers memory. It decides when a program is run by the central processing unit, whether that program can access the computer's input and output devices. And when you think your computer is running many programs at once, in reality, its the operating system that's quickly switching between programs, sharing that CPU for fractions of a second. - Inside every computer is an operating system managing software that controls the computer's hardware. The software is as series of commands made of simple binary code, and that binary code is just electrical signals flowing through billions of tiny circuits. - Computers have the potential to do all kinds of amazing things, but the only thing that makes computers smart or useful is you. When you learn to code, you get to define the problem you want to solve and write the software that turns those ideas into reality. That gives you the power to build things that matter to you, your community, and the world.