컴퓨터 하드웨어는 어떻게 구성되는가
- 1장 비트의 특성과 특성을 활용하는 법
- 2장 3장에서는 비트를 사용하는 이유와 이를 하드웨어로 구현하는 방법
- 기본적인 전자 부품과 이를 조합하는 여러 가지 방법
컴퓨터
- 전자 부품을 다양하게 조합해 비트를 조작하는 회로를 만들수 있음
- 컴퓨터는 크게 3가지 부분으로 나뉨
- 메모리 - 기억장치(Memory)
- 입력과 출력 - I/O (input and output)
- 중앙 처리 장치 - CPU(central processing unit)
메모리
- 컴퓨터에는 조작할 비트들을 저장할 장소가 필요함
- 집이 빈틈없이 늘어선 거리와 같음
- 모든 집은 크기가 똑같고 모든 집에는 정해진 개수 만큼 비트를 저장할 수 있는 방이 있음
- 컴퓨터를 만드는 규칙에는 각 집마다 1바이트를 저장한다고 되어 있음
- 실제 거리와 마찬가지로 각 집에는ㅌ 주소(Address)가 부여됨
- 예제
- 컴퓨터 메모리 크기가 64MiB면 전체는 64 x 1,024 x 1,024 = 67,108,864바이트( 또는 546,870,912비트)
- 각 바이트에는 0부터 67,108,863까지 주소가 붙어 있음(1부터 시작하고 기껏해야 몇천 번까지밖에 없는) 실제 거리와 달리 컴퓨터에서는 이런 주소가 의미가 있음
3 메모리 길
처럼 구체적인 주소에 있는 메모리를 가리킬 때 메모리 위치(memory location)라는 말을 자주 사용
- 메모리의 기본 단위가 바이트라는 것이 꼭 바이트 단위로만 데이터를 읽어야 한다는 뜻은 아님
- 예를 들어,
- 32비트 컴퓨터는 보통 메모리를 4바이트 덩어리
- 64비트 컴퓨터는 8바이트 덩어리로 구성
- 차선이 더 많으면 더 많은 데이터를 데이터 버스에 실을 수 있기 때문에 더 많은 양의 데이터를 처리할 수 있다
- 메모리를 주소로 지정할 때는 어떤 대상(1바이트, 4바이트, 8바이트 등)을 원하는지 지정해야 한다
- 32비트 4바이트, 64비트 8바이트를 사용하기 때문에 긴 워드의 주소를 지정하는 방법은 1바이트의 주소를 지정하는 방식과는 다름
- 다른 관점
- 32 비트 컴퓨터의 메모리 구조를 포플렉스(집이 4개 연달아 붙어 있는 땅콩집)가 늘러서 있는 길로 생각할 수도 있다
- 각 포플렉스에는 다스 듀플렉스(집이 2개 붙어 있는 땅콩집)가 2개 들어 있고 각 듀플렉스에는 유닛(한 세대)이 2개 들어 있음
- 이 말은 우리가 각 유닛이나 듀플렉스 또는 포플렉스의 주소를 지정할 수 있다는 뜻
- 각 건물과 고속도로가 연결될 때 바이트마다 각기 다른 차선을 배정받고, 긴 워드는 고속도로 전체를 사용한다는 사실을 확인하라
- 도심을 오가는 비트들은 좌석이 4개인(네 차선에 걸친) 버스를 사용해 오가며, 버스 좌석은 차선마다 하나씩 이다. 현대적 컴퓨터에서 이 버스는 오직 한 건물(포플렉스)에만 정차해 비트를 태워서 도심으로 돌아옴
- 이 말은 주소가 5,6,7,8인 바이트를 사용하는 긴 워드를 사용할 수 없다는 뜻