36 lines
		
	
	
		
			925 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			925 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| Booth:
 | |
|   result = multiplier << 1
 | |
|   loop (operand length) times:
 | |
|     if last two bits are 01:
 | |
|       result(upper half) += multiplicand
 | |
|     if last two bits are 10:
 | |
|       result(upper half) += twos_comp(multiplicand)
 | |
|     remove extra bits from result
 | |
|     arithmatic shift result right
 | |
|   result >> 1
 | |
| 
 | |
| Modified booth:
 | |
|   multiplicand(MSB) = multiplicand(second MSB)
 | |
|   result = multiplier << 1
 | |
|   loop (operand length / 2) times:
 | |
|     if last two bits are 001 or 010:
 | |
|       result(upper half) += multiplicand
 | |
|     if last two bits are 011:
 | |
|       result(upper half) += multiplicand * 2
 | |
|     if last two bits are 100:
 | |
|       result(upper half) += twos_comp(multiplicand) * 2
 | |
|     if last two bits are 101 or 110:
 | |
|       result(upper half) += twos_comp(multiplicand)
 | |
|     remove extra bits from result
 | |
|     arithmatic shift result right twice
 | |
|   result >> 1
 | |
|   result(second MSB) = result(MSB)
 | |
|   result(MSB) = 0
 | |
|     
 | |
|       
 | |
|     
 | |
|     
 | |
|   
 | |
| 
 | |
|      
 | 
