当前位置:网站首页>【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语言程序
边栏推荐
- String common API
- LeCun指明下一代AI方向:自主机器智能
- MicroBlaze serial port learning · 2
- What is the difference between real-time rendering and pre rendering
- Unsupported major. minor version 52.0
- Simulation of two-color ball system to judge the winning situation
- [download attached] installation and use of penetration test artifact Nessus
- Hundreds of lines of code to implement a JSON parser
- Create a new MySQL database under Linux and import SQL files
- 爬虫(1) - 爬虫基础入门理论篇
猜你喜欢
Two methods for MySQL to open remote connection permission

Google play index table

Lecun points out the direction of next generation AI: autonomous machine intelligence

中国传奇教授李泽湘,正在批量制造独角兽

Policy Center-User Data

go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)

Modifying MySQL password under Linux: error 1396 (HY000): Operation alter user failed for 'root' @ 'localhost‘

Hundreds of lines of code to implement a JSON parser

什么是XR扩展现实,XR云串流平台有哪些

24:第三章:开发通行证服务:7:自定义异常(来表征程序中出现的错误);创建GraceExceptionHandler来全局统一处理异常(根据异常信息,构建对应的API统一返回对象的,JSON数据);
随机推荐
Policy Center > Device and Network Abuse
Unsupported major. minor version 52.0
MySQL proxy middleware atlas installation and configuration
互联网研发效能之去哪儿网(Qunar)核心领域DevOps落地实践
Cesium-1.72 learning (earth model creation online offline tile)
【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子
Policy Center > Device and Network Abuse
flinkcdc如果监控的数据库为mongo就必须是集群版吗
Asp. NETCORE uses cache and AOP to prevent repeated commit
CVPR 2022 - Tesla AI proposed: generalized pedestrian re recognition based on graph sampling depth metric learning
Practical cases of data visualization (timeline rotation diagram, streamlit control year metabase visualization tutorial) 2.0
Create a new MySQL database under Linux and import SQL files
Is your light on? Before you start to solve a problem, you need to know what the "real problem" is
Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
Which direction should college students choose to find jobs after graduation?
GaussDB创新特性解读:Partial Result Cache,通过缓存中间结果对算子进行加速
备战数学建模36-时间序列模型2
Generating verification code with sring
RTP 发送PS流零拷贝方案
Oracle 导出视图的创建语句