How does computer hardware and software work together to process information?

Preston gave a pretty good description of how the hardware and software work together. I can add a few links that can help with the descriptions of how computers work.

This is a bit dated, but it is still good info: The CPU and Memory

Here is another link I pulled out of the guts of Google that has some more good stuff in it: How do computers work? A simple introduction

Basically, the hardware does all the work, the Operating System acts as an interpreter between the hardware and software and the applications are the interface with the user to perform functions on the computer.

There is a lot of g

Preston gave a pretty good description of how the hardware and software work together. I can add a few links that can help with the descriptions of how computers work.

This is a bit dated, but it is still good info: The CPU and Memory

Here is another link I pulled out of the guts of Google that has some more good stuff in it: How do computers work? A simple introduction

Basically, the hardware does all the work, the Operating System acts as an interpreter between the hardware and software and the applications are the interface with the user to perform functions on the computer.

There is a lot of good stuff out there, the trick is being able to get Google to spit it up on your screen for you. It seems to do pretty well with ‘how does X work (Replace x with your choice of subject). What is X is another good search. Neither one will bring up detailed, hard, technical information but it gives very good layman’s terms and is excellent as a stepping stone if you are unsure of anything. Such as What is an AS400? (That search was a lifesaver when I encountered this beastie, being one of those Windoze guys.)

Software is the set of instructions used to direct the operation of the hardware causing it to solve some problem. Software is the communication link between hardware and users. There are two main types of software present in all computer systems; system software and application software, and within these two categories there are subcategories.Hardware is the physical components of a computer system: the keyboard, monitor, disk drive, printer, circuits, chips, printed circuit boards...”.

Lots of questions here ... let's start with the first: Connection between HW/SW and how they interact.

Very simplistically: the CPU (Central processing unit) translates the software into "actions" which is performed by the hardware, and decides on what piece of software to look at next due to signals sent from other hardware, results from its previous calculations, software instructions, etc.

To get a more clear picture you might be served by understanding what they are. E.g. hardware is the physical "stuff" inside a computer and the peripheral devices (e.g. printer) connected to it (i.e. all th

Lots of questions here ... let's start with the first: Connection between HW/SW and how they interact.

Very simplistically: the CPU (Central processing unit) translates the software into "actions" which is performed by the hardware, and decides on what piece of software to look at next due to signals sent from other hardware, results from its previous calculations, software instructions, etc.

To get a more clear picture you might be served by understanding what they are. E.g. hardware is the physical "stuff" inside a computer and the peripheral devices (e.g. printer) connected to it (i.e. all those wires, chips, circuit boards, switches, connectors, etc.).

Software is the electrical signals (a set of on/off signals) which tell those devices what should be done when. In general these things are referred to as programs, in that they "program" the hardware into understanding what its purpose is. These are usually "saved" for later re-use instead of having to make them from scratch each time. In order to save these some other hardware is used, e.g. a hard drive which saves such (and can later recall them) as spots on a magnetic coating.

HW/OS: The hardware is still the same, an OS (operating system) is a piece of software which makes it easier to run other software instead of each "program" having to directly reference each item of the hardware.

OS/SW: The operating system is software. It's just a piece of software capable of organizing other software to run on the hardware. It keeps everything in check, trying to prevent one SW from interfering with another, giving other SW a consistent way to interact with HW and each other instead of needing each connection to be different.

SW/Internet: Signals (sets of on/off electrical pulses) sent over a cable / radio / etc. using the hardware device called a NIC (Network interface card) and then reading and interpreting those signals on the other end. The internet is just an interwoven "web" of these connections with a pre-designed set of protocols stating what certain sets of signals mean. The internet generally uses IP (Internet Protocol) and TCP(Transmission Control Protocol) which keeps these signals organized by stating from where and to where, in what order, for what purpose, what should be done, what reply is required, etc.

Browser/Internet: Browser is simply a software program specializing in a particular type of internet traffic called http (Hypertext Transfer Protocol). HTTP is a set of signals in such a format as to make them interpretable as a web page with text, pictures, sound, video, and extra sets of instructions (i.e. "software" inside that page). Usually the format in this is HTML.

Internet/Virtual Cloud: Cloud refers to another computer (or more than one or "virtual" computers within one or more "real" computers) doing stuff for you. Either saving data or calculating some result. The Internet is simply a way for such computer to send/receive signals (electrical pulses constituting the data / instructions) to and from your own computer. The same applies to any two (or more) computers which interact between each other by passing such signals across any connection, e.g. a local network (LAN) or radio (WiFi). Cloud is just a new "buzz word" for the same old same old as was always used for servers providing "services" to clients and/or dumb-terminals, generally means it specializes in sending these signals across the global network referred to as the internet.

HW/HW: Any two physical devices connected through some means with each other, or even more than two devices. This can be done in any sort of signal transfer, e.g. electrical pulses along a wire or radio signals, etc. Each such connection may have protocols designed which state how these signals should be formatted in order to be understandable instead of just garble. E.g. the LAN cable between two computers send signals between each other when you copy a file from one to the other.

To answer all these more in depth would take several years, to anser them all exhaustively would probably take several lifetimes. That's why you get university courses in CS (Computer Science). That's exactly what CS focusses on, these interactions between HW/SW/OS/Network/etc. and how these then interact with the physical environment (users, occurrences, phenomena, etc.). If you really want to know all these things properly you should thus think about doing a course in Computer science.

A modern operating system interacts with applications and hardware in a supervisor role. Somewhat simplified; when a processor starts running it is executing code in privileged mode, from where the code has unrestricted access to all of the hardware. One of the things that may be done from privileged mode is creating new execution contexts with fewer privileges, which is used to run applications and other code that is not supposed to be able to compromise the integrity of the running system.

Each execution context will typically be set up to provide the illusion it is the only code running on t

A modern operating system interacts with applications and hardware in a supervisor role. Somewhat simplified; when a processor starts running it is executing code in privileged mode, from where the code has unrestricted access to all of the hardware. One of the things that may be done from privileged mode is creating new execution contexts with fewer privileges, which is used to run applications and other code that is not supposed to be able to compromise the integrity of the running system.

Each execution context will typically be set up to provide the illusion it is the only code running on the system, by using the concept of virtual memory, where the memory addresses available to the program only indirectly map to the actual physical RAM. This technique is also what enables mapping e.g. a filesystem as a secondary backup memory for data that does not fit in the available RAM chips. This virtualization is effectively restraining the code running in the unprivileged execution context, which is unable to directly access any code or data within another context.

Communication from the application to the operating system is usually done using software interrupts. The application can trigger an interrupt using a certain processor instruction (or sequence of instructions), which will switch the execution context to privileged mode, from where the operating system takes over to determine what the application wants to do, based on the contents of the processor registers. This is known as performing a system call. The OS may from there decide to read from or write to addresses or hardware ports, that map to actual, physical hardware. The entire concept of hiding the physical hardware from the application code can be thought of as presenting it with a virtual machine, which is then realized by the OS.

The application can interact with the virtual machine using system calls, and by polling for certain events (such as, “a key was pressed”) which the OS will post on a message bus. This is one of the mechanisms by which the operating system can feed back into the running applications.

To accommodate having each application (process) running within its own virtual machine, oblivious of each other, an operating system must perform context switching (or task switching), unless there is a separate processor or processor core available for running every single process. Running concurrent processes is also known as multitasking. Modern operating systems typically employ preemptive multitasking, where the OS sets up a hardware timer interrupt, which every so often will interrupt the running process and go to privileged mode, from which the OS will preserve the execution state and then switch the execution context to that of another process. This way, many processes can be run concurrently (but not simultaneously) on a single processor core.

This is of course all just a simplified overview, and glosses over a lot of special cases and ugly nitty-gritties. For further reading I can recommend for example the CS classic on the subject; “Modern Operating Systems” by Andrew Tanenbaum.

There is a simple answer to this and a very complex answer. I will try to go with simple, since I am not the total expert, and it's easier to assume you aren't either (or you wouldn't be asking).

Hardware- This is the stuff you can touch. It's hard and heavy.

Software- This is the stuff you can't touch. Technically, it's really just a bunch of magnetized/demagnetized spots on a medium, or a set of very tiny open or closed switches in a memory chip.

Lets put this into a very simple example. Riding a bike.

The bike and your body are the hardware. The knowledge of how to ride the bike and where y

There is a simple answer to this and a very complex answer. I will try to go with simple, since I am not the total expert, and it's easier to assume you aren't either (or you wouldn't be asking).

Hardware- This is the stuff you can touch. It's hard and heavy.

Software- This is the stuff you can't touch. Technically, it's really just a bunch of magnetized/demagnetized spots on a medium, or a set of very tiny open or closed switches in a memory chip.

Lets put this into a very simple example. Riding a bike.

The bike and your body are the hardware. The knowledge of how to ride the bike and where you want to go is the software. The chain and the pedals move the wheels, the handlebars steer and the body provides the motive force as well as the fine tuning for navigation. But the head has the information that instructs the body how to pedal and to maneuver, while also providing the map navigating to your destination. Without your brain, the bike is just a piece of metal and rubber that doesn't do anything.

Now we'll move to a little more detail.

Your computer is really just a bunch of machinery. Motors, switches and storage devices. Some of these are VERY small, with millions of switches and microcircuits built in.

When you turn on your computer, it is like a baby that has absolutely no knowledge whatsoever. It needs to be fed instruction every single time you start it up.

The first set of instructions is in the BIOS (Basic Input/Output System). These are the instructions that tell the computer how to access things like Memory, Processors and Harddrive. The device that holds these instructions is a small device with two types of memory, called ROM (Read Only Memory) and RAM (Random Access Memory). Rom holds hardcoded information that can't change, while RAM is dynamic, and can be rewritten. However, RAM requires electricity to maintain that information, so a small battery is placed on the computer to support it.

Once the BIOS tells the processor how to access various components, the hard drive is started to take over the boot up tasks. This is where you have your operating system, like Windows, as well as every other program you have loaded.

When starting up (and also when adding things like USB devices), drivers, another instruction type of software, are loaded for every piece of hardware you have. Drivers have the instructions that tell the CPU (the actual brain) how to access and operate devices at a mechanical level.

At its very basic, software is a series of 1's and 0's. Or you can think of them as On/Off switches. Every piece of software is binary (using only 1's or 0's). The operating system of the computer is what takes any software code and translates it into binary. You can think of these 1's and 0's as positions on a switch.

If your computer was a light switch, your software would be exactly 2 digits long. If the software wants the light on, it sends a 1, which closes the switch and turns on the light. Sending a 0 opens the switch, and turns off the light.

A computer program does the exact same thing. Except there are tens of millions of tiny switches, and they determine how the computer is going to act. Some basic actions the computer performs require the combined activity of thousands of these switches.

When you look at a color on your monitor, the software is telling the CPU what color to display in a specific pixel, or single dot on your monitor. The color black is notated as binary 000000000000000000000000, while white is 1111111111111111111111111, and gray is 011001000110010001100100. The software also has to tell the CPU which pixel to make that color, so another binary number is issued for that location.

Many of these switches are on the CPU itself, but there are processors in the video graphics card, the sound card and the network card that help out the CPU and speed the process up.

When you look at the CPU, every one of those dots on the underside are a pathway, either in or out. The software activates or deactivates the microswitches and determines which path the instructions travel.


The above diagram is the underside of a very simple microprocessor. Each of the dots are the end of a switch. The software tells which switch to open or close, determining where the instructions are going to end up.

Software is the set of instructions executed on hardware.

Software can usually be compiled for any hardware but it can be specifically optimized if the software developer knows the hardware well enough.

Software is usually written in a high level language (C, Java) or scripting languages (Perl, python) but needs to be reduced to a low level language (usually to assembly language first then machine code) in order to execute on hardware. This process of converting from high level to low level is known as compiling.

High level languages can have complex instructions that compile into many low level

Software is the set of instructions executed on hardware.

Software can usually be compiled for any hardware but it can be specifically optimized if the software developer knows the hardware well enough.

Software is usually written in a high level language (C, Java) or scripting languages (Perl, python) but needs to be reduced to a low level language (usually to assembly language first then machine code) in order to execute on hardware. This process of converting from high level to low level is known as compiling.

High level languages can have complex instructions that compile into many low level instructions. The low level instructions are the instructions built into the cpu of the hardware.

The steps to execute each low level instruction are physically printed into the cpu semiconductor substrate, so there are usually just a few simple low level instructions understood by a type of cpu.

By knowing the exact set of instructions understood by a particular cpu, the sizes of cpu-cache (fast memeory on the cpu chip) and other features of the hardware design a developer can optimize his code to get the best performance from a particular piece of hardware.

A cpu operates at a particular clock speed measured in cycles per second or hertz. (Mega Or Giga hertz for high speed cpus) Usually a cpu is rated at the clock speed it can safely operate at, before generating so much heat as to cause damage to itself.

This speed rating is roughly the number of low level instructions it can execute in one second. There are other factors affecting this, such as how much data is needed to execute the instruction. It takes a few clock cycles to load data from cache and more to load data from RAM to cache and even more to load data from disk into ram. So an instruction may have to waste several clock cycles, waiting for data, before it can execute against that data.

I hope this answers what was meant by the question of the relationship between hardware and software.

Most IoT devices run on small embedded processors without a lot of resources.

For instance, I’m writing this on a MacBook Pro with a very fast CPU that has four processor cores, 16GB of RAM and half a terabyte of storage.

An IoT device might be a single core CPU that’s a tenth the speed of my MacBook Pro, has 128MB of RAM (so 1/125th the RAM of my computer) and a minuscule amount of flash storage. And that might be a luxurious device :)

If you have at least basic knowledge of how the hardware works you can use it more effectively and better live within the its constraints.

Most programmers are use

Most IoT devices run on small embedded processors without a lot of resources.

For instance, I’m writing this on a MacBook Pro with a very fast CPU that has four processor cores, 16GB of RAM and half a terabyte of storage.

An IoT device might be a single core CPU that’s a tenth the speed of my MacBook Pro, has 128MB of RAM (so 1/125th the RAM of my computer) and a minuscule amount of flash storage. And that might be a luxurious device :)

If you have at least basic knowledge of how the hardware works you can use it more effectively and better live within the its constraints.

Most programmers are used to writing software that runs under Windows, macOS or UNIX/Linux. It takes some effort to exhaust the resources on those systems. For instance, if your application ends up using more memory than the system has, it may automatically borrow some disk space to simulate having even more memory (using virtual memory and paging).

An embedded processor in an IoT device likely can’t do that. If you run out of memory… that’s it. Game over.

If your IoT device is battery powered then power management is a huge issue. How do you minimize the power your device needs - can you put the system to sleep? how does it wake up? do all the components sleep?

Ultimately it really depends on the nature of the device. But it’s likely that at least a little understanding of how the device’s hardware works, what its limitations are and why they matter will help quite a bit.

The basic answer is that the operating system of the computer connects them. However it goes a bit deeper than that.

There are three main parts of an operating system. The GUI or graphical user interface, drivers, and the Kernal.

The GUI does pretty much what it says on the tin: it allows the user to manage the operating system in a graphical manner, rather than through the command line.

You've probably heard of having to upgrade graphics cards drivers. A driver is a piece of software which tells the operating system how to communicate with a specific piece of hardware, such as a graphics card. T

The basic answer is that the operating system of the computer connects them. However it goes a bit deeper than that.

There are three main parts of an operating system. The GUI or graphical user interface, drivers, and the Kernal.

The GUI does pretty much what it says on the tin: it allows the user to manage the operating system in a graphical manner, rather than through the command line.

You've probably heard of having to upgrade graphics cards drivers. A driver is a piece of software which tells the operating system how to communicate with a specific piece of hardware, such as a graphics card. These are constantly updated in order to get the best possible performance out of the hardware.

Finally there is the Kernal. The Kernal is that interprets this mishmash of stuff between the software and hardware. It is the core of the operating system. You may have heard of the Linux Kernal. All the distributions of Linux (Ubuntu, mint, Debian, ECT) have the same Kernal but different GUI's. Without this Kernal, nothing could function, and your GUI would be pointless.

Typically, a small program that interfaces devices to the Operating System is called a “Device Driver”. A second answer to your question might be the Operating System itself, but the operating system primarily address the CPU and memory, which I wouldn’t consider to be devices.

Device drivers are written as separate programs with a software interface designed to work with the Operating System. This is done so the Operating System can remain relatively un-changed despite the addition of an indeterminate number of devices.

A book could be written on this topic. You should probably make your question more specific.

I can only answer generally, and tersely.

The computer has a CPU

The CPU executes instructions, for example to add two numbers

Software is made up of instructions to the computer; the software may not directly use the computer’s own instructions. The software, for example, could be in Python, which is interpreted and converted to an intermediate code. But in the end, CPU instructions are executed.

The rest of the computer hardware provides access to input and output from the user, the network, or storage.

This is the hardware

The hand operating it gives the hardware instructions in a sequence to get the result. This is what software does.

Hardware tends to advance quickly from a user perspective… Insert a new processor and calculations complete faster.

Need to make changes to the instructions (software) to match changes to your business? That could take a lot of time and far greater cost.