如何二进制翻译成硬件? [英] How does binary translate to hardware?

查看:148
本文介绍了如何二进制翻译成硬件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我明白code的编译方式组装,而且组件是1:1置换二进制codeS。有人可以帮我了解二进制是如何连接的硬件?如何二进制物理读取和运行?如何在硬件if语句的工作?

I understand how code is compiled to assembly, and that assembly is a 1:1 replacement with binary codes. Can somebody help me understand how binary is connected to the hardware? How is the binary physically read and run? How does an if statement work in the hardware?

从<一个href=\"http://www.google.com/#hl=en&source=hp&q=how+is+binary+data+put+on+a+line+of+a+bus&aq=0&aqi=g2&oq=how+is+binary+&fp=7d15299a959dbb33\">google搜索的,我想,也许我的问题标题应该是怎么放二进制数据线路上的公交车,但我不知道。

From google searches I'm thinking that maybe my question title should be "how is binary data put on a line of a bus" but I wasn't sure.

感谢

推荐答案

我觉得这其实是一个有趣的问题。我会说:这里是如何在几个简单的步骤打造一台电脑。

I think this is actually a fun question. I would say "here's how to build a computer in a few easy steps".


  • 先从一些简单的逻辑电路,如AND,OR,NOT和触发器。双稳是一对布置的晶体管这样如果一个为ON,其它为OFF,或反之亦然。这样,就可以记住一个比特的信息,所以你可以把它看成一个存储一个二进制数字。一些输入线可以把它放在一个国家或其他,因此写给它。

  • Start with some simple logic circuits, such as AND, OR, NOT, and a flip-flop. A flip-flop is a pair of transistors arranged so that if one is ON, the other is OFF, or vice-versa. That way it can "remember" one bit of information, so you can think of it as a storing a single binary digit. Some input lines can put it in one state or the other, and thus "write" to it.

您可以通过让一束触发器存储一个更大的数量,并把它称为注册。例如,如果你在一个寄存器四个触发器中,有16种可能的组合,所以你可以把它看成拿着一个从0号到15。

You can store a bigger number by having a bunch of flip-flops, and call it a "register". For example, if you have four flip-flops in a register, there are 16 possible combinations, so you can think of it as holding a number from 0 to 15.

直接跳到一点点,你可以买一个内存芯片。什么是寄存器是一个很好的数字,就像他们说的16。它有4个电线(地址线)来了,它有4根线出来(数据线)。因此,从0〜15的数可以进来作为地址,而选择16个寄存器,它的值是psented在输出数据线$ P $(从而阅读的话)中的一个。另外几根电线可能会导致数据进来的数据线导致号码被放入(写入)的寄存器。

Skipping ahead a little bit, you can buy a "memory chip". What that is is a good number of registers, like say 16 of them. It has 4 wires coming in (the "address" wires), and it has 4 wires coming out (the "data" wires). So a number from 0 to 15 can come in as an address, and that selects one of the 16 registers, whose value is presented on the output data wires (thus "reading" it). Another few wires can cause data to come IN on the data wires to cause numbers to be put into ("written") the register.

现在假设你有一个外部的4位寄存器(称为R),有点电路,使之1)presents R中的内存地址的值,2)读取在该寄存器和4位值将其移动R,然后重复一遍又一遍。

Now suppose you have an external 4-bit register (call it R), and a bit of circuitry, so that it 1) presents the value in R to the memory address, 2) reads the 4-bit value at that register and moves it into R, then repeats over and over.

根据已pre加载到内存中的数字,你可以看到,这件事情将循环各地通过一系列的数字地址,因为在每个地址数量决定下一个地址将是什么。

Depending on the numbers that have been pre-loaded into the memory, you can see that this thing will cycle around through a series of numeric addresses, because the number at each address determines what the next address will be.

现在,你可以美化这个东西在很多方面。您可以将内存扩展到拥有地址的5位(32个寄存器)。然后,如果输入的地址线之一被连接到外面的世界,它会做取决于外界不同的事情。这是一个有限状态机。

Now, you can embellish this thing in a lot of ways. You can expand the memory to have 5-bits of address (32 registers). Then if one of the address lines is connected to the outside world, it will do different things depending on the outside world. That's a "finite-state-machine".

您可以替换一个简单的计数器R寄存器,并把它称为程序计数器。你可以把数据传出来的内存,并调用它的指令,并使用一些位用于读取其他存储地址,载入一个集中的算术寄存器。你可以使用一些控制R寄存器是否只是增加,或者得到存储在一个新的地址。这就是所谓的跳跃。

You can replace the R register with a simple counter, and call it a "program counter". You can take the data coming out of the memory and call it an "instruction", and use some of its bits to read other memory addresses and load a set of arithmetic registers. You can use some to control whether the R register simply increments, or maybe gets a new address stored in it. That's called "jumping".

当然,这是一个非常简单的计算机,但是这是大概他们是如何起家的。

Of course, this is a very simple computer, but that's roughly how they started out.

这篇关于如何二进制翻译成硬件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆