简体   繁体   English

电路解码所需的最小输入位数

[英]Minimum number of input bits required by a circuit to decode

I'm learning about computer architecture and I was reading about encoders and decoders.我正在学习计算机体系结构,并且正在阅读有关编码器和解码器的信息。 In a MIPS processor, the opcode has 6 bits.在 MIPS 处理器中,操作码有 6 位。 I was wondering how many input bits are needed to build a decoder to decode opcodes?我想知道构建解码器来解码操作码需要多少输入位? I know that a decoder is a combinational circuit that converts binary information from n input lines to a maximum of 2^n unique output lines .我知道解码器是一种组合电路,可以将二进制信息从 n 个输入行转换为最多 2^n 个唯一的 output 行 Knowing that the opcode is 6 bits, does that mean I need only 3 bits because 2^3 is 8 and the theoretical maximum number of outputs will be 8?知道操作码是 6 位,这是否意味着我只需要 3 位,因为 2^3 是 8,理论上最大输出数将是 8?

The opcode in the machine instruction word is the input to the decoding process, which may involve a digital logic circuit of the same name, a binary decoder .机器指令字中的操作码是解码过程的输入,解码过程可能涉及同名的数字逻辑电路,即二进制解码器

There are 2^6 possible values for the 6-bit opcode field, and thus 2^6 possible different patterns of output (internal control signals) you might want to decode to. 6 位操作码字段有 2^6 个可能的值,因此您可能想要解码 output(内部控制信号)的 2^6 个可能的不同模式。

See https://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats#Opcodes for an incomplete table of some common instructions.有关一些常用指令的不完整表格,请参阅https://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats#Opcodes (missing xori , probably others). (缺少xori ,可能还有其他)。

https://uweb.engr.arizona.edu/~ece369/Resources/spim/MIPSReference.pdf also lists opcode details for another subset of the available MIPS opcodes. https://uweb.engr.arizona.edu/~ece369/Resources/spim/MIPSReference.pdf还列出了可用 MIPS 操作码的另一个子集的操作码详细信息。 (missing bgezal and bltz for example.) (例如缺少bgezalbltz 。)

Note that all R-type instructions share the same opcode, and the func field is used to select which operation.请注意,所有 R 型指令共享相同的操作码, func字段用于 select 是哪个操作。 But I-type instructions do each use different values for the opcode field, leaving enough bits left for up to 2 registers and a 16-bit immediate.但是 I 型指令确实每个都使用不同的操作码字段值,为最多 2 个寄存器和 16 位立即数留下足够的位。 There are many more than 8 unique opcode-field values that a MIPS CPU has to recognize. MIPS CPU 必须识别超过 8 个独特的操作码字段值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM