Мазмунга өтүү

Бул сабак азырынча кыргыз тилине которула элек, ошондуктан англис тилинде көрсөтүлдү.

Сабактын башталышы

The Machine's Path Depends on Data

Among the processor's few actions, one has been waiting quietly since its lesson: choose which action to perform next. Today it steps forward. Combined with comparison, it gives the machine something no calculator has — a path that is not written down anywhere, but born at run time from the meeting of program and data. This lesson is where machines stop being player pianos.

Learning goals: explain how compare-then-choose makes the executed path depend on data; trace both paths of one small program by hand; and state the consequence with long shadows — why a program's conduct cannot, in general, be read off its text.

Start with the question

A music box plays its pins in order — always the same tune. The idealized machine also performs actions in strict sequence, one per tick. So: is the machine a music box? Where would different behavior on different days even come from?

From two bricks meeting. The processor can compare two numbers. And the processor's marker — its place in the row of command-cells — is itself changeable: the action "choose what's next" moves the marker, to one address or another, depending on the comparison's outcome. That is the entire mechanism, and it deserves slow reading: the program text contains BOTH continuations, written once and forever; which one runs is decided at run time by whatever numbers the comparison happens to meet. The text is fixed; the path through it is not.

compare A, B A < B ? yes: marker to cell 600 no: marker to cell 640 actions of branch 1 actions of branch 2 Both branches exist in the text forever. The data chooses which one becomes conduct.

Nothing here violates the clock: still one action per tick, still strict sequence — the sequence of performed actions is as orderly as ever. What changed is that this sequence is no longer a copy of the text's order. Two runs of one program are two different journeys through the same country.

Бул сабакты YourAIZone платформасында улантыңыз

Толук сабакта — толук түшүндүрмө, чыгарылган мисалдар, көп кездешкен каталар, заматта текшерилүүчү тесттер жана ЖИ-репетитор. Конок катары дароо баштаңыз же прогрессти сактоо үчүн аккаунт түзүңүз.

Толук сабакта

  • Толук түшүндүрмө
  • Чыгарылган мисалдар
  • Көп кездешкен каталар жана алардан кантип качуу керек
  • Тест суроолору: 2
  • Тема боюнча суроолорго жооп берген ЖИ-репетитор
  • Окуучу, ата-эне жана мугалим үчүн прогрессти көзөмөлдөө