Advanced Binary b. describe and use two’s complement and sign and magnitude to represent negative integers; c. perform integer binary arithmetic, that is addition and subtraction; d. explain the use of code to represent a character set (ASCII, EBCDIC and UNICODE);
Negative binary As well as positive numbers Binary can also be used to represent Negative numbers. (-19,-18 etc). There are a number of ways of displaying negative numbers. You must know 2: 1.Sign and Magnitude 2.Twos Complement
Sign & Magnitude The MSB is used as a sign bit. 1 for - 0 for + So 1011 would mean -3 NOT 11
Twos complement = = = = = = = 3 How can you tell if its -3 or 253? The exam question will tell you!
Convert negative denary to binary. Convert negative denary to binary: 1.Find the positive binary value 2. Starting from the right leave all the digits alone ppup to and including the first Change all the other digits from 0 to 1 or 1 to 0.
Convert – 12 to binary: 1. Find the positive binary value Starting from the right leave all the digits alone up to and including the first Change all the other digits from 0 to 1 or 1 to
Binary addition = = 1 0+1=1 1+1= =11
Binary addition = = 1 0+1=1 1+1= = Carry bits
Binary subtraction Convert the number to be subtracted into a negative number THEN add them together = ? 7 = = 1011
Binary subtraction 7 = = The extra bit is discarded
Representing a Characters set using Binary ASCII UNICODE EBCDIC Find out what each of the above are and why they are used. Write it into your notes.
ABCD < abcd