Algorithms and Data Structures in C part 3

Chia sẻ: Dasdsadqwe Dsadasdsadsa | Ngày: | Loại File: PDF | Số trang:6

0
48
lượt xem
3

Algorithms and Data Structures in C part 3

Mô tả tài liệu
Download Vui lòng tải xuống để xem tài liệu đầy đủ

The sign, an - 1, of A is simply extended into the higher order bits of B. This is known as signextension. Sign extension is illustrated from 8-bit 2’s complement to 32-bit 2’s complement in

Chủ đề:

Bình luận(0)

Lưu

Nội dung Text: Algorithms and Data Structures in C part 3

1. satisfies this case. (b) (an - 1 = 1) For this case By noting that The assignment of bk with satisfies the condition. The two cases can be combined into one assignment with bk as The sign, an - 1, of A is simply extended into the higher order bits of B. This is known as sign- extension. Sign extension is illustrated from 8-bit 2’s complement to 32-bit 2’s complement in Table 1.5. Table 1.5 2’s  Complement  Sign  Extension 8‐ 32‐Bit   Bit     0xff   0xffffffff  0x0f   0x0000000f  0x01   0x00000001  0x80   0xffffff80  0xb0   0xffffffb0