electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Hardware/Software interface


Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> Hardware/Software interface
Author Message
saeddawoud



Joined: 27 Apr 2007
Posts: 156
Helped: 3


Post27 Jun 2007 14:32   

Hardware/Software interface


Hello
we know when writting in high-level language the statements converted into assembly language using the compiler and then into machine code using assembler. ok, but what I can't understand how these binary digits converted into hardware actions.
Regards
Back to top
kishore2k4



Joined: 17 Jun 2006
Posts: 293
Helped: 33


Post27 Jun 2007 14:45   

Re: Hardware/Software interface


Well first of all they are not just a stream of binary digits, they are chunks also know as insutructions. Each instruction is made of an opcode(operation code to decide to perfrom which operation like add,sub,mov etc) and 1 or more operands(the data on which to operand)

Consider:
add a,b; This adds a to b and puts the value in a again. This can be roughtly coded to something like 1101 00 01, where 1101 is indicating to add, 00 points to accumulator and 01 points to b register(for an 8-bit CPU)

Depending on the archtecture, they will vary rather widely. You can read up some books on digital design like morris mano where you'll have an abstract level understaning of what you are looking for.
Back to top
saeddawoud



Joined: 27 Apr 2007
Posts: 156
Helped: 3


Post27 Jun 2007 14:51   

Re: Hardware/Software interface


hello
Thanks for that, but I knew what you said. my question was: suppose the opcode field is 000000 which is the op for R-type in MIPS architecture, up to this point these digits are software, now how these bits converted into hardware actions? i.e.: how these bit converted into electrical signals in the hardware??
Back to top
cl_mos



Joined: 15 Jun 2007
Posts: 6
Helped: 1


Post27 Jun 2007 19:25   

Re: Hardware/Software interface


One way this is done is by the use of microcode. The opcode is read in which can be an address in a special memory that holds the microcode. There is also something called a sequencer that constantly counts upwards. The first thing that is done on an instruction is that the sequencer is set to zero and the look up is at the part of the opcode that states the microcode address. The data is read in from this address and then executed via decoder. The decoder tells the control logic what to do for that cycle. Decoding the microcode might be something like large AND function if the value FF mean to put the value of a register on an internal bus. (when this and is high the signal goes to a mux) The register to mux is defined by a part of the microcode also. After the next clock the sequencer counts to the next position in the microcode memory array and might do something like capturing the data from the internal bus. After the complete instruction is done then the last bit of microcode would tell that it is finished and the instruction counter is updated for the next instruction to be loaded in. The sequencer then resets to zero awaiting the next main instruction that tells it where to look up. This is the way it used to be. This now a days is only done with a few instructions that take multiple cycles. Now most instructions are read in and it goes through a pipeline that takes many cycles to finish but once the pipeline is filled the executed instructions happen almost every cycle and sometimes more than one. The opcode holds the key to what happens at each stage of the pipeline.

For more information try Computer Architecture A Quantitative Approach by John L Hennessy and David A Patterson.

Hope this helps.

Added after 12 minutes:

Actually an even better book to look at which gives more details is
Computer Organization & Design The Hardware / Software Interface by David A Patterson & John L Hennessy. The Quantitative approach book assumes that the information in this book is already known.
Back to top
kishore2k4



Joined: 17 Jun 2006
Posts: 293
Helped: 33


Post27 Jun 2007 21:46   

Re: Hardware/Software interface


saeddawoud wrote:
hello
Thanks for that, but I knew what you said. my question was: suppose the opcode field is 000000 which is the op for R-type in MIPS architecture, up to this point these digits are software, now how these bits converted into hardware actions? i.e.: how these bit converted into electrical signals in the hardware??


Ask yourself, how would you do it in software? By using a case statement perhaps?
There will a be hardware circuit called the Control Unit(this is a very simplistic view) within the CPU. The input to the control unit is the opcode, so if the input is a valid opcode it will generate appropriate signals to the ALU, Load-Store unit etc.

Take our previous example, the opcode says to add two numbers specified in A and B registers. So the CU(Control Unit) will tell the ALU to add the two numbers present at its inputs. The inputs are routed to the ALU using MUXes(Multiplexors).

I am assuming you know how a simple ALU works. If not, its just a big combinational circuit where the inputs are control signals (from the CU in our case) and operands and the output is the result of selected operation.

As cl_mos suggested you need atleast a little background in digital design to easily understand this.
Back to top
saeddawoud



Joined: 27 Apr 2007
Posts: 156
Helped: 3


Post28 Jun 2007 1:47   

Re: Hardware/Software interface


e.g.: add a, b, c # using MIPS architecture
now suppose b = 5, and c = 6, the adder works on these numbers as electrical signals, how to convert the numbers to electrical signals??
Back to top
agent_009



Joined: 17 Dec 2006
Posts: 49
Helped: 7


Post29 Jun 2007 6:33   

Hardware/Software interface


saeddawoud! you are confusing software with hardware. All the working of your computer is done in form of electric signals. The software part is merely the representation for the users.
So when we say a=6; actually we are reserving a memory location and assigning it value 6, BUT all this is actually done in hardware in form of electric signals. a=6; is its visual representation for us, in actual it is all done in the form of electric signals in the microprocessor and memory.
Back to top
saeddawoud



Joined: 27 Apr 2007
Posts: 156
Helped: 3


Post29 Jun 2007 9:24   

Re: Hardware/Software interface


how do we assign memory location that contains 6? when we assign variable a value, this value will eventually translated into electrical signals and all the work done in hardware. The question is: how the translation done from software to hardware? i.e.: from value to electrical signals??
Regards
Back to top
shabab



Joined: 03 Apr 2007
Posts: 64
Helped: 3


Post03 Jul 2007 6:54   

Hardware/Software interface


Do You Want TO Transfor Data In Binaray Stream
Back to top
saeddawoud



Joined: 27 Apr 2007
Posts: 156
Helped: 3


Post03 Jul 2007 10:22   

Re: Hardware/Software interface


hello
6 in decimal = 00000000000000000000000000000110 in binary
the number 6 in a program is a software number, what is the method to convert it into electrical signal?? what is the algorithm and the steps to do that?
regards
Back to top
sam khan



Joined: 28 Mar 2007
Posts: 46
Helped: 8


Post10 Jul 2007 14:35   

Hardware/Software interface


heloo
pl u give me idea about how to interface with matlab
Back to top
Google
AdSense
Google Adsense




Post10 Jul 2007 14:35   

Ads




Back to top
Akhthar Ali Khan



Joined: 02 Mar 2007
Posts: 13
Location: Chennai


Post02 Aug 2007 11:13   

Re: Hardware/Software interface


Hi

The binary numbers are represented by voltages. For example let us take representation of 6 in binary 00000000000000000000000000000110. Here 1 is represented by high voltage say 5 Volts and 0 is represented by Low voltage say 0 volts.

Consider 1 = 5 volts (High - H) and 0 = 0 Volts (Low - L) then the 6 can be represented as

LLLLLLLLLLLLLLLLLLLLLLLLLLLLLHHL

So if you want to feed 6 to the processor through a 32 bit data bus, you have to supply the voltage level to the respective PINS of the bus. Actually there is no physical form for software. It is just a virtual representation of the work done by the hardware. For example when you type a code or any thing on your keyboard the data is sent in binary format represented in voltage levels not as a character.

Hope this may help you.

regards.
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PC Programming and Interfacing -> Hardware/Software interface
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Hardware/Software interface (4)
serial port interface btw hardware and software... (5)
CAN - USB interface hardware and software help needed (6)
hardware interface and a hardware controller (1)
Hardware Interface (4)
Hardware Interface Help (1)
Best C++ book for hardware interface? (3)
hardware description of network interface card (5)
Hardware/software co-design (5)
Hardware/Software codesign (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS