blob: a9af9d6370d3f71ebe9b7276397e23488091d0d8 (
plain)
1
2
3
4
5
6
7
8
|
//Example 24.8
clc
disp("1''s compliment method")
disp(" 1 0 0 0")
disp(" 0 1 0 1 <-- 1''s complement")
disp(" -------")
disp(" 1 1 0 1")
disp("No carry results and the answer is the 1''s complement of 1101 and opposite in sign, i.e. -0010.")
|