Diagrams for signed binary
This commit is contained in:
		
							parent
							
								
									4e8052dd42
								
							
						
					
					
						commit
						03b3135401
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -19,11 +19,11 @@ For example the two's complement of $0101$ (binary 5) is $1011$. There is a simp
 | 
			
		|||
1. Take the unsigned number, and flip the bits. In other words: invert the values, so $0$ becomes $1$ and $1$ becomes $0$.
 | 
			
		||||
2. Add one
 | 
			
		||||
 | 
			
		||||
// INSERT DIAGRAM HERE
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
To translate a signed number to an unsigned number you flip them back and still add one:
 | 
			
		||||
 | 
			
		||||
// INSERT DIAGRAM HERE
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
### Advantages
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -64,11 +64,9 @@ A simple way to work out the value of a signed number as contrasted with an unsi
 | 
			
		|||
 | 
			
		||||
Thus for a 4-bit number:
 | 
			
		||||
 | 
			
		||||
// INSERT PLACE VALUE DIAGRAM HERE
 | 
			
		||||
 | 
			
		||||
Then if we add the decimal equivalents of the place value together, we get our signed number. So in the case of $-3$:
 | 
			
		||||
 | 
			
		||||
// INSERT DIAGRAM HERE
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
## Considerations
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue