deer-develop / study

2 stars 0 forks source link

쿼츠 시계 vs 기계식 시계 #16

Open swimmingone opened 5 months ago

swimmingone commented 5 months ago

“Unlike combinational chips, which are oblivious to time, the outputs of sequential chips depend not only on the inputs in the current time but also on inputs and outputs that have been processed previously.”

“These memory devices, along with the arithmetic devices built in chapter 2, comprise all the chips needed for building a complete, general-purpose computer system—a challenge that we will take up in chapter 5.”

2장에서 만든 ALU 랑 3장에서 만드는 Memory device 만 있으면, 완전한 general-purpose 컴퓨터를 만들 수 있는 거구나!

아직은 잘 상상이 안 된다.

... “data flip-flop (DFF), is the fundamental building block from which all memory devices will be built. In spite of its central role, though, the DFF is a low-profile, inconspicuous gate: unlike registers, RAM devices, and counters, ...”

얘도 unsung hero네. 2장에서는 2의 보수법이 unsung hero 였다.

“In reality, outputs are always delayed,”

우리 눈엔 바로 되는 것 같아 보여도 실제론 아니다. 사실 당연히 그럴 수 밖에 없지.

“instead of viewing time as a continuous progression, we prefer to break it into fixed-length intervals, called cycles”

철학자와 물리학자의 시간은 continuous(연속적)이고, 컴퓨터 과학자의 시간은 discrete(이산적)이다.

철학자와 물리학자의 시계는 기계식 시계고, 컴퓨터 과학자의 시계는 쿼츠 시계다.

“To sum up, the cycle length is chosen to be slightly longer than the maximal time delay in any chip in the system”

cycle length는 짧을 수록 좋은데 time delay 보다는 길어야 됨.

time delay 를 줄이는 데는 물리적 한계가 있을 것 같은데, 그럼 cycle length를 줄이는 데도 한계가 있겠다.

cycle length를 줄이는게 클럭 속도를 높이는거니까, 이게 지난 주에 명재형이 말했던 거랑 같은 건가? (뭔가 한계가 있어서 코어 수를 늘리는 거다~)

“The most fundamental sequential gate is the DFF, and any chip that includes it, either directly or indirectly, is also said to be sequential.”

계산을 여러 개 묶어서 만든 함수도 액션 하나를 포함하면 액션이 되는 것과 비슷하다

“All we have to do is ensure, when we build the computer’s clock, that the duration of the clock cycle will be slightly longer than the time it takes a bit to travel the longest distance from one chip to another, plus the time it takes to complete the most time-consuming within-chip calculation. This way, we are guaranteed that by the end of the clock cycle, the ALU’s output will be valid. This, in a nutshell, is the trick that turns a set of standalone hardware components into a well-synchronized system.”

0,1,0,1 깜빡거리는게 왜 컴퓨터에 필요하다는 건지 잘 이해가 안 됐었는데 여기서 이해됐다!

이런 시스템이 있기 때문에 물리적으로 생길 수 밖에 없는 시간차를 무시하고 마치 동시에 모든 일이 일어나는 것처럼 처리할 수 있게 되는 거구나.

프론트엔드 개발할때 비동기적으로 받아온 데이터를 동기적인 것처럼 처리하는 방법에 대한 고민을 하게 되는데, 엄청 저수준의 하드웨어 단계에도 거의 비슷한 고민과 추상화가 있다는게 신기하고 재밌다!

deerhamyungjin commented 5 months ago

영인: 철학자의 시간은 기계식 시계인데 컴퓨터과학자의 시계는 쿼츠다. 조합칩과 순차칩은 함수형 프로그래밍의 계산과 액션이 생각했다. 덕수: 내가 계산할 기준점을 만들어주고 구분점을 주는 게 복잡도를 많이 줄여준다. 비동기 처리가 동기 처리보다 복잡한데 단순하게 처리하는 방식이네 ㅎ 영인: 2장에서 시간을 신경쓰지 않아도 된다고 한 이유를 3장에서 이해할 수 있었다.