How does the hardware and software interact to make the computer work?

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.

The operation code provided by a machine language instruction ( software) is input to the control unit [ Control unit - Wikipedia] along with timing signal derived from the clock in the CPU.

The output from the control unit are the control signals which activate data manipulation in various units of the computer hardware.

One needs to understand the fetch and execute cycles in the instruction cycle [ Instruction cycle - Wikipedia ] to understand the interaction of software and hardware.

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.

Well usually it is the other way around, Computer software complements computer hardware.

I have seen how professional companies build enterprise-sized softwares that actually rely on hardware, multiple devices to be correct, to transfer medical data from patients to doctors. Infact, the input and output endpoints were all hardware. The software was just a “middle man” to the technology (this ofcourse is not entirely true. Alot of technology lies within software too).

Infact, in a technological way of thinking - usually you come up with the hardware and then build its software drivers (or softwa

Well usually it is the other way around, Computer software complements computer hardware.

I have seen how professional companies build enterprise-sized softwares that actually rely on hardware, multiple devices to be correct, to transfer medical data from patients to doctors. Infact, the input and output endpoints were all hardware. The software was just a “middle man” to the technology (this ofcourse is not entirely true. Alot of technology lies within software too).

Infact, in a technological way of thinking - usually you come up with the hardware and then build its software drivers (or software ‘ client service’) upon it. This is not always how things work (since the business way of thinking is exactly opposite, you match the lower levels to the higher level requriements).

But, in general if hardware is supposed to complement computer software - it is usually for 2 types of reasons: As an input / output device, or as a different control unit.

Input and output is pretty much straight forward. However a different control unit is used as an external ‘authority’ or ‘manager’ of the softwares’ functions or the decisionmaker of multiple softwares on multiple machines targeting the same goal.

An example will be of much better use: Say you have a CT (Digital Radiography) room in the hospital. Now this room consists of: An operator console (a smart computer for the room technician to operate in), A generator (what essentially shoots radiation at the patient), a patient bed (that can move, rotate and adjust to different situations), a detector (what receives that radiation from the generator with the patient in between them) and the processing unit (what takes the radiation input from the detector and *makes* an image of the patient). All these components are each built from their respective hardware and software. Managing this would be VERY difficult alone. There needs to be a ‘control unit’ that has all the other components connected to (wired or wireless, really doesn’t matter for this theory) - this unit also needs to manage the procedure of the current operation, decide what to signal to which device. So it will be kind of the following procedure:

** A patient is placed in the bed, ready of a CT scan. *

  • The operator consoles tells the CU (Control unit) to shoot the patient.
  • The CU tells the detector to prepare for a CT shoot (the detector now awaits radiation).
  • The CU tells the generator to shoot radiation,
  • The detector receives radiations and sends the data to the CU.
  • The CU accepts the data from the detector and gives it to the PU (processing unit) for physical calculations.
  • The PU sends the CU the image. (Edit: There are alot of physical calculations to be done in order to transfrom the detector captured data into a digital radiography image)
  • The CU sends the operator console the image with metadata like time of the shoot, etc..

As you can see, the CU (Control Unit) takes a big role in the whole process. Doing this without a CU is possible - but will be ten times complicated to make, operate properly and understand problems in the development process.

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.

There are a couple of good, complete answers to your question. I wonder if you are actually wondering how not why computers combine hardware and software.

For an answer to how they do that, I'd still refer to Farshad's answer. The hardware is designed to respond to a bunch of little electrical signals, represented by 1s and 0s. On the most basic level, you can 'tell' your hardware to do something by sending it, 11001001, for instance.

Down at that very basic level, I tend to think of the old wind-up music boxes. The bumps are 1s, the smooth parts 0s, and as they pass the metallic comb, y

There are a couple of good, complete answers to your question. I wonder if you are actually wondering how not why computers combine hardware and software.

For an answer to how they do that, I'd still refer to Farshad's answer. The hardware is designed to respond to a bunch of little electrical signals, represented by 1s and 0s. On the most basic level, you can 'tell' your hardware to do something by sending it, 11001001, for instance.

Down at that very basic level, I tend to think of the old wind-up music boxes. The bumps are 1s, the smooth parts 0s, and as they pass the metallic comb, you get little 'plinks' that make a tune.

Of course computer hardware is much more complicated, but that's a physical representation of how you make something cool happen out of a binary input mechanism.

Once you have the hardware responding to 1s and 0s, then software becomes shorthand. You could say that the command "load" means 11001010, "move" means 10111101 and "store" means 01010110 (I'm just making these up here).

Then you could say that "save" means "load move store"

Then you could say that clicking a button with a floppy disk means "save"


Let's look at this "."

To the user (me) it is a period, a grammatical stop. To the browser, it is an ASCII character. To the video card, it is a clump of grey pixels. To the video processor in the monitor, it is a group of brightness values with locations. And somewhere down in there, there are some ones and zeros that make the pixels light up.

Plink

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.

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.

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.)

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.

It’s the firmware, installed on the ROM chip of the motherboard. It is of two types: Basic Input/Output System (BIOS), used in computers made in 2009 or earlier, and Unified Extensible Firmware Interface (UEFI), found in modern computers.

The firmware is the screen you see upon turning on your computer, with the manufacturer’s logo and sometimes keys to enter the firmware settings.

UEFI is more secure and advanced than BIOS, as it supports features such as Secure Boot, which loads only verified operating systems, and also mouse cursors and better UI.