banner



What Does A Register Look Like In C

Others have already done what strikes me as a reasonable task of answering your first question, so I'one thousand going to concentrate on your second question. Hither'south a rough idea of one way to construction a CPU.

enter image description here

This is assuming a CPU on the full general order of an x86, where many operations specify a source and a destination annals, where the source field really specifies both a source and a destination. That is, you take the specified source and destination registers as inputs, modify them as specified in the instruction, and deposit the result in the specified destination.

So in this motion-picture show, I haven't tried to show the instruction decoder, just the three primary fields: the source, destination, and op-code fields. The source and destination fields each choose a register to read from, and feed into all the functional units. The op-code field and so chooses which of those results to keep. The destination field is also fed to a demultiplexer to cull which register to write the result to.

For a CPU that has split up fields for source ane, source 2, and destination, the destination field would connect to the demultiplexer, and the source i and source ii fields would connect to the first two multiplexers.

Side note: the technique of feeding the operands to all the execution units and using a multiplexer to choose which of those to keep is used primarily in relatively small CPUs, at least in my experience. For a couple of examples, this is used in both the 6502 and (at least some versions of) the Xilinx Picoblaze.

For "larger" CPUs, you lot could apply a demux continued to the op-code field, feeding an enable line for each execution unit. In this case, you could use pull-downs on the outputs, and wire-or the results.

Of course, a modern high-terminate CPU has a considerably more complex structure. In item, with multiple instructions executing concurrently, your results volition usually be written to a large banking concern of rename registers, with a separate demux for each execution unitone, then in 1 cycle y'all might do an addition that deposits its result in 1 register and as well a multiplication that deposits its outcome in a different register.

Oh, and of course, this is but showing a subset of the real instructions. In a real CPU, you'd typically have a fair number more than. As well you might easily have more than 8 registers. This doesn't really affect the structure though, just the widths of the mux/demuxers.


ane. Well, since those wide muxes and demuxes tin exist fairly expensive, yous typically don't actually have a split up demux for each execution unit of measurement. Rather, you might take, say, half a dozen or so groups of execution units, each with a demux to choose its destination, allowing up to six instructions to execute in parallel.

What Does A Register Look Like In C,

Source: https://electronics.stackexchange.com/questions/476334/where-are-registers-and-what-do-they-look-like

Posted by: catronacloned.blogspot.com

0 Response to "What Does A Register Look Like In C"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel