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

39922 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Outline the differences between how a compiler and an interpreter works, and explain the advantages and usage of of each [12 marks]


Given an ordered array of integers "V" and a integer "Sum", write a function that would return "true" if it finds two numbers in V that add up to Sum, and "false" otherwise.


Explain how a stack could be used in the process of evaluating an expression in Reverse Polish notation.


When data is transmitted over long distances, latency can become an issue. Explain what latency is.


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–2025

Terms & Conditions|Privacy Policy
Cookie Preferences