How to represent a negative decimal number using 8-bit binary two's complement ?

First of all we need to convert our decimal negative number into binary without taking the sign into account. Then we have to apply some rules to convert positive binary into a negative one. To do so we have to change all the 0s into 1s and all the 1s into 0s, and then we add 1 to the result of the previous step. The number we will get at the end is the number we were looking for. Example: So for example if we want to represent -15 into binary using two's complement, we convert 15 into 8 bit binary number, and we get 0000 1111. Now we have to conver 15 into -15, to do so we apply the rules mentioned above, so we replace 1s with 0s and 0s with 1s and we get 1111 0000 and then we have to add 1, and the result we were looking for is: 1111 0000 + 1 = 1111 0001 So -15 = 1111 0001

Answered by Hassan I. Computing tutor

36847 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Explain how the fetch execute cycle works? Include the specific registers and buses being used


Write pseudocode for the binary search algorithm and state, with an explanation, it's worst case complexity in big-O notation


What is an interface and why are they useful?


Image a graph. In which instances is it more appropriate to use an adjacency list instead of an adjacency matrix?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy