早教吧 育儿知识 作业答案 考试题库 百科 知识分享

跪求计算BCD码已知BCD码X、Y,求X+Y、X-Y:(1)X=[00110100]BCD,Y=[00100110]BCD;(2)X=[10011000]BCD,Y=[01000100]BCD;(3)X=[00100111]BCD,Y=[01101001]BCD;(4)X=[01010001]BCD,Y=[10000111]BCD.

题目详情
跪求计算BCD码
已知BCD码X、Y,求X+Y、X-Y:
(1)X=[00110100]BCD,Y=[00100110]BCD;
(2)X=[10011000]BCD,Y=[01000100]BCD;
(3)X=[00100111]BCD,Y=[01101001]BCD;
(4)X=[01010001]BCD,Y=[10000111]BCD.
▼优质解答
答案和解析
(1)X=[00110100]BCD=[34]十,Y=[00100110]BCD=[26]十;
X+Y=[00110100]BCD+[00100110]BCD
=[01100000]BCD=[60]十
X-Y=[00110100]BCD-[00100110]BCD
=[00001000]BCD=[8]十
(2)X=[10011000]BCD=[98]十,Y=[01000100]BCD=[44]十;
X+Y=[10011000]BCD+[01000100]BCD
=[000101000010]BCD=[142]十
X-Y=[10011000]BCD-[01000100]BCD
=[01010100]BCD=[54]十
(3)X=[00100111]BCD=[27]十,Y=[01101001]BCD=[69]十;
X+Y=[00100111]BCD+[01101001]BCD
=[10010110]BCD=[96]十
X-Y=[00100111]BCD-[01101001]BCD
=[01010100]BCD=[58]十(向高位借一)
(4)X=[01010001]BCD=[51]十,Y=[10000111]BCD=[87]十.
X+Y=[01010001]BCD+[10000111]BCD
=[000100111000]BCD=[138]十
X-Y=[01010001]BCD-[10000111]BCD
=[01100100]BCD=[64]十(向高位借一)