当前位置:网站首页>【Verilog基础】十进制负数的八进制、十六进制表示
【Verilog基础】十进制负数的八进制、十六进制表示
2022-06-30 15:44:00 【ReCclay】
题目:将-617转换成八进制和十六进制数(补码)
犯错:(-617)D=(-1151)O=(-269)H
原因分析:如果是正数的话,上面的思路是正确的,但是由于正数和负数在原码、反码、补码转换上的差别,所以按照正数的求解思路去对负数进行求解是不对的。
正确的方法是:首先将-617用补码表示出来,然后再转换成八进制和十六进制(补码)即可。
注:二进制补码要用16位。
正确答案:(-617)D=(176627)O=(fd97)H
负数十进制转换成八进制或十六进制方法如(-12)10=( )8=( )16
第一步:转换成二进制
1000 0000 0000 1100
第二步:补码,取反加一
1111 1111 1111 0100
第三步:转换成八进制是三位一结合:(177764)8
转换成十六进制是四位一结合:(fff4)16
C语言程序
边栏推荐
- Cloud XR, how to help industrial upgrading
- Using asp Net core creating web API series
- Modifying MySQL password under Linux: error 1396 (HY000): Operation alter user failed for 'root' @ 'localhost‘
- Arcmap操作系列:80平面转经纬度84
- Container common commands
- Policy Center > Google Play‘s Target API Level Policy
- Go zero micro Service Practice Series (VIII. How to handle tens of thousands of order requests per second)
- microblaze 串口学习·2
- Types of waveguides
- 大学生研究生毕业找工作,该选择哪个方向?
猜你喜欢
随机推荐
There are so many kinds of coupons. First distinguish them clearly and then collect the wool!
Parameter optimization - bias and variance
[time series database incluxdb] code example for configuring incluxdb+ data visualization and simple operation with C under Windows Environment
Simulation of two-color ball system to judge the winning situation
边缘计算平台如何助力物联网发展
从第三次技术革命看企业应用三大开发趋势
互联网研发效能之去哪儿网(Qunar)核心领域DevOps落地实践
Modifying MySQL password under Linux: error 1396 (HY000): Operation alter user failed for 'root' @ 'localhost‘
The image variables in the Halcon variable window are not displayed, and it is useless to restart the software and the computer
中国传奇教授李泽湘,正在批量制造独角兽
Table responsive layout tips for super nice
Three development trends of enterprise application viewed from the third technological revolution
婴儿认知学习所带来的启发,也许是下一代无监督机器学习的关键
flinkcdc如果监控的数据库为mongo就必须是集群版吗
360 digital, ant group, etc. were selected as member units of the "business security promotion plan" of the Chinese Academy of Communications
MySQL transaction / lock / log summary
Imeta | Ye Mao / Shi Yu reviewed the dynamic shuttle and ecological function of intracellular and extracellular genes in the environmental microbiome
Log4j2 进阶使用
Does flinkcdc have to be a clustered version if the monitored database is Mongo
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid







