Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how does hardware and software work together

Status
Not open for further replies.

vead

Full Member level 5
Joined
Nov 27, 2011
Messages
285
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Activity points
3,815
hello
i am confused. i tried Google but i could not find correct answer
computer hardware consist of ICs memory, processor
i write something like hello in programming language
but hardware does not understand whats that means

i want to know how text hello convert into machine language


high level language- c c++ hello
translations compiler convert hello to machine code
binary language sequence 10111101
voltage on transistor low or high (AND,OR gate ICs

i am not sure that i am correct
please check me if i wrong
and explain little bit
thanks lots............
 

Hi,
Good question.
Well...
when you write a program in C ,Java , ... there is s.th called "assembler" that assembles the high level language to assembly.
After that , another thing called "compiler " , compiles this assembly code to machine code like 01001010010111 .
Since computer is made of transistors , This binary code is understandable for computer . "1" means ON and "0" means OFF.
I think reading computer architecture will be useful for u.
"Computer Architecture , Written by : John L. Hennessy, David A. Patterson" it's a good book.
Also this might be helpful :
https://www.cs.iastate.edu/~prabhu/Tutorial/title.html
 

Actually i can say that any software (that you write) is at the end just configures some hardware blocks.
ie whan you write 2+3 machine code (binary sequence) is just apply numbers as registers to adder block and enable that block to do adding operation.
Have a check attched lecture note.

Hope helps
 

Attachments

  • LECTURE7.PDF
    552.2 KB · Views: 67

one quick note...
in my previous answer , s.th is wrong...
In fact assembler converts the assembly code to machine code , and compiler converts the C,Java,... to assembly.
Sorry for mistake.
 

Yes essentially you are correct in your way of thinking, the only bit that is hard to get your head around is the sheer number of transistors involved that are used to make up all the logic gates. What I found helpful in my understanding of the relationship between hardware and software was a course that I did in VHDL which allowed me to see the link between the two and how logic gates can be used to create assembly language commands like a command to add things together. It sounds like you have got the basic idea of it though, I would recommend having a look at some things like a binary adder using logic gates, or a binary counter using flip-flops, this would give you a much better idea of how the hardware relates to the software side of things.

Hope this helps.

/Pheetuz
 

hi everyone
i would like to thanks everyone for every help but i can not understand clearly
computer has bunch of electronics switch that are either on/off
when we enter the key on keyboard i think first signal goes throw the keyboard then goes memory where the program is store then programming code and key compare by compiler. compiler convert key into machine language
 

Put in extremely simple terms, when you press a key such as "0" on your key board it is converted into a binary number (through a mixture of hardware and software) which is then sent as a string of 1s and 0s to the receiving computer, this computer then takes this binary number and store it somewhere in memory, either in RAM or possibly in some other kind of memory, for more information about how this is done a good example to look up would be "floating gate" - type this into google.
(The further I am going on with this example the more I am realising how deep an understanding of computer science and electronics is needed to understand what is happening).
In a computer you have two types of memory, program memory and RAM (at least), when you write a piece of software on your computer in C, the compiler takes the C code and compiles it into assembly code, this assembly code is then assembled into machine code by an assembler and placed in program memory, if your computer is 32bits then the length of each machine code would be 32bits.
In your computer you have what is called a program counter which contains the address of the next machine code instruction to be executed, when that count reaches the address in memory of the machine code instruction that the assembler has created, that binary representation is placed onto the data bus of the computer, the top 10 bits (maybe) are linked to enables for different hardware functional blocks, so for example the top 10 bits being equal to "1111011001" might turn on the adder unit in hardware, the remaining 22 bits are then used as the binary representations of the numbers to be added together.

Your question is basically asking someone to explain a large chunk of computer science / electronics to you which I don't think anyone will be able to summarise in a forum post, if you really want to understand the relationship and how it all works together in harmony then you are going to have to stick with electronics for a while, your question is a very good one though, just a very expansive one!

/Pheetuz
 
  • Like
Reactions: 7@rB

    7@rB

    Points: 2
    Helpful Answer Positive Rating
thanks everybody such great help for me and special thanks for pheetuz
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top