1-2강 - Java Primitive Type, Variable, Constant
cf> Data type 공부 전 알아둘 내용 class가 variable의 data type이 된다. 그래서 대부분의 variable은 object이다. 하지만 일부 중 primitive type이라는 것이 있다. (primitive type은 class에 속하지 않는다.) 3. Primitive Types 1) Integer type 1> 종류 byte (1 byte): -128 ~ 127 short (2 bytes): -32,768 ~ 32,767 int (4 bytes): -2,147,483,648 ~ 2,147,483,647 long (8 bytes): -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 2> integer type 중 사용하고 싶은..
1-3강 - Digital systems and number systems 3 (BCD, Gray code, Hamming code)
5. Binary Coded Decimal 1) Binary Coded Decimal BCD : 8, 4, 2, 1 code (BCD를 일반적으로 8,4,2,1 code라고 부른다.) - 10진수를 2진수로 표현한 것 (옛날 컴퓨터에서 10진수를 편하게 입출력하기 위해 사용) - 8, 4, 2, 1은 weight을 의미한다. - 즉, BCD code는 weighted code이다. - decimal digits(0~9) 각각을 weight을 기반으로한 binary number로 표현한다. 2) BCD addition BCD의 특성상 해당 bit(4-bit)가 9를 넘지 않아야하는데 넘는 경우에는 10을 빼주면 된다. 하지만 10을 그냥 뺄수는 없으니 modulo 16이라고 생각하고 6을 더한다. 여기도 ..