slug
type
status
category
summary
date
tags
password
icon
Sign-Magnitude Representation:
  • The most significant bit (MSB) represents the sign (0 for positive, 1 for negative).
  • The remaining bits represent the magnitude of the number.
  • Example: In 8-bit representation, +5 is 00000101 and -5 is 10000101.
 
In a binary system, 100-38=62, how is the number -38 represented here?
 
To represent the number -38 in binary, we need to use the concept of two's complement, which is the most common method for encoding negative numbers in binary. Here are the steps:
notion image
notion image
 
 
notion image
 

Example:

Convert the denary number -14 into 8-bit binary number using two’s complement.

 

Solution:

目标数: -14
第1步: 取正 00001110( 正数14)
第2步: 取反 1 1110001
第3步:加一 1 1110010
 
1c Converting between Binary, Octal, and Hexadecimal1e ASCII
Loading...