大尾数法和小尾数法 [英] Big Endian and Little Endian

查看:157
本文介绍了大尾数法和小尾数法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出的是可字节寻址计算机的内存快照.如果机器为大端且为小端时,在执行指令lw $16, 24($17)之后将加载到寄存器$16中的内容.寄存器$17包含200.

Given is the snap shot of memory of a byte-addressable computer. What would be loaded into register $16 after execution of instruction lw $16, 24($17) if machine is big endian and when Little Endian. Register $17 contains 200.

现在,根据我的说法,无论Little Endian还是Big Endian,都会从内存(224-227)中复制四个字节,然后,如果计算机是Big Endian,那么它们将被原样复制到寄存器中.

Now according to me, four bytes would be copied from the memory (224-227) irrespective of Little Endian or Big Endian,then if the machine is Big Endian then they will be copied to the register as they are.

如果机器是Little Endian,则将其反转,然后复制到寄存器中.

If the machine is Little Endian then will be reversed and then copied to the register.

如果我对这个概念有误,请指导我.

Please guide me if I am wrong with the concept.

推荐答案

您是对的.

从技术上讲,在大端模式下,最高有效字节是地址最低的字节,而最低有效字节是地址最高的字节.在小端模式下,最高有效字节是地址最高的字节,而最低有效字节是地址最低的字节.

More technically, in big-endian mode, the most significant byte is the one with the lowest address, and least significant byte is the one with the highest address. In little-endian mode, the most significant byte is the one with the highest address, while the least significant byte is the one with the lowest address.

所以$ 16寄存器的内容将是

So the contents of $16 register would be

如果是大端字节-> BADADBBD 如果是小尾数-> BDDBDABA

If big-endian -> BADADBBD If little-endian -> BDDBDABA

这篇关于大尾数法和小尾数法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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