Computer Architecture,  Study

[Computer Arch.] Arithmetic Shift / Logical Shift

Computer system에는 크게 두 가지 shift 방식이 존재한다.

1. Arithmetic shift

Arithmetic shift example

Arithmetic shift의 경우 logical shift와 shift-left의 경우는 동일하지만, shift-right의 경우 sign bit이 그대로 복사된다.

2. Logical shift

Logical shift example

위 그림과 같이 logical shift의 경우 shift left 또는 shift right의 경우 모두 0으로 나머지 bit가 채워진다.

Leave a Reply

Your email address will not be published. Required fields are marked *