diff --git a/src/components/PartDescription.tsx b/src/components/PartDescription.tsx
index f04987d..3964c6f 100644
--- a/src/components/PartDescription.tsx
+++ b/src/components/PartDescription.tsx
@@ -4,6 +4,7 @@ import type { CCComponent } from "../store/component";
import { IntrinsicComponentDefinition } from "../store/intrinsics/base";
import { definitionByComponentId } from "../store/intrinsics/definitions";
import { type TruthTable, truthTableOf } from "../store/intrinsics/truthTable";
+import { BitNotationContext } from "./bitNotation";
import { MarkedText } from "./MarkedText";
import { TruthTableView } from "./TruthTableView";
@@ -33,13 +34,17 @@ export function pinNotesOf(
export function PartDescription({ component }: { component: CCComponent }) {
const messages = useMessages();
const definition = definitionByComponentId.get(component.id);
+ // A part is the same outside the stages, so its table writes bits as the editor shows
+ // them, not as the stage tables do
return (
-
+
+
+
);
}
diff --git a/src/i18n/en.ts b/src/i18n/en.ts
index 5c44173..4af388a 100644
--- a/src/i18n/en.ts
+++ b/src/i18n/en.ts
@@ -49,7 +49,7 @@ const stageTexts: Record = {
"half-adder": {
title: "Adding one digit",
goal: [
- "From here on, think of [ON] as [1] and [OFF] as [0], and the tables write them that way too. Then {A} + {B} is 0, 1 or 2. Binary writes numbers with only 0 and 1: just as 9 + 1 carries over and becomes 10 in everyday numbers, 1 + 1 carries over and becomes 10 in binary. So 0, 1 and 2 are [00], [01] and [10] in two digits. A digit of a binary number is called a bit.",
+ "From here on, think of [ON] as [1] and [OFF] as [0], and the tables of the stages' circuits write them that way too. Then {A} + {B} is 0, 1 or 2. Binary writes numbers with only 0 and 1: just as 9 + 1 carries over and becomes 10 in everyday numbers, 1 + 1 carries over and becomes 10 in binary. So 0, 1 and 2 are [00], [01] and [10] in two digits. A digit of a binary number is called a bit.",
"Output the left digit (the twos digit) to {C} and the right digit (the ones digit) to {S}. {C} is called the carry and {S} the sum, and this circuit is called a half adder.",
],
steps: [],
@@ -81,7 +81,7 @@ const stageTexts: Record = {
],
steps: [
"Place a {FlipFlop}. A {FlipFlop} outputs what it received at the time step before, and [0000] at the first time step. Connect its output to {Count} and to the {7seg} at the top right.",
- 'Place a {Const}. A {Const} always outputs the value written in it. Change [00000000] in its box to [0001] and press (four bits, to match the {B} it connects to). The "4 bits" below the box is the number of bits of the value.',
+ 'Place a {Const}. A {Const} always outputs the value set in its box. Change [00000000] in its box to [0001] and press (four bits, to match the {B} it connects to). The "4 bits" below the box is the number of bits of the value.',
'Place "{Adding four digits}". Connect the output of the {FlipFlop} to its {A}, the {Const} to its {B}, and its {S} to the input of the {FlipFlop}. Then the number the {FlipFlop} outputs plus 1 comes out of the {FlipFlop} at the next time step. {C} is not used.',
"Press the play button and go through the time steps with the right arrow . Press to go on by itself, one time step a second. The circuit works when the {Display} at the top right shows 0 to F in turn.",
],
@@ -140,7 +140,8 @@ export const en = {
AGGREGATE: "Joins values into one, the upper pins as the higher digits.",
FLIPFLOP:
"Outputs what it received at the time step before. At the first time step, it outputs [OFF], or a value of all [0] bits if its output has two or more bits.",
- CONST: "Always outputs the value written in it.",
+ CONST:
+ "Always outputs the value set in its box. To change it, change the value in the box while editing and press . The output has as many bits as shown below the box.",
BROADCAST: "Repeats a one-bit value over two or more bits.",
ANDN: "[ON] only when every bit of {In} is [1].",
ORN: "[ON] when any bit of {In} is [1].",
@@ -155,8 +156,8 @@ export const en = {
} satisfies Record,
pinBitWidth: (pinName: string, canAddPins: boolean) =>
canAddPins
- ? `The number in an {${pinName}} pin is its number of bits. Click an {${pinName}} pin while editing, and a field for each {${pinName}} pin appears, from the top. adds a field at the bottom, and removes the bottom one. Change the numbers in the fields and press , and the {${pinName}} pins follow the fields.`
- : `The number in the {${pinName}} pin is its number of bits. To change it, click the pin while editing, change the number in the field and press .`,
+ ? `The number in an {${pinName}} pin is its number of bits. Click an {${pinName}} pin while editing, and a box for each {${pinName}} pin appears, from the top. adds a box at the bottom, and removes the bottom one. Change the numbers in the boxes and press , and the {${pinName}} pins follow the boxes.`
+ : `The number in the {${pinName}} pin is its number of bits. To change it, click the pin while editing, change the number in the box and press .`,
about: (name: string) => `About ${name}`,
ofStage: "Available parts",
},
@@ -253,7 +254,8 @@ export const en = {
parts: "Parts",
goalHeading: "Goal",
stepsHeading: "Steps",
- digitsLegend: "The tables write ON as 1 and OFF as 0.",
+ digitsLegend:
+ "The tables of the stages' circuits write ON as 1 and OFF as 0.",
check: "Check",
checking: "Checking…",
passed: "Cleared! The circuit works for every combination of the inputs.",
diff --git a/src/i18n/ja.ts b/src/i18n/ja.ts
index d552668..eba25b8 100644
--- a/src/i18n/ja.ts
+++ b/src/i18n/ja.ts
@@ -22,7 +22,8 @@ export const ja: Messages = {
AGGREGATE: "上のピンを上の桁として、値を1つにまとめる。",
FLIPFLOP:
"1つ前のステップで受け取った値を出す。最初のステップでは [OFF] を、出力が2ビット以上ならすべてのビットが [0] の値を出す。",
- CONST: "中に書いた値をいつも出す。",
+ CONST:
+ "欄で決めた値をいつも出す。値は、編集中に欄を書きかえてを押すと変わる。出力のビット数は、欄の下に表示されるビット数。",
BROADCAST: "1ビットの値を、同じ値が並んだ2ビット以上の値に広げる。",
ANDN: "{In} のビットがすべて [1] のときだけ [ON]。",
ORN: "{In} のどれかのビットが [1] なら [ON]。",
@@ -135,7 +136,7 @@ export const ja: Messages = {
parts: "部品",
goalHeading: "目標",
stepsHeading: "手順",
- digitsLegend: "表では、ON を 1、OFF を 0 と書いています。",
+ digitsLegend: "課題の回路の表では、ON を 1、OFF を 0 と書いています。",
check: "確かめる",
checking: "確かめています…",
passed: "クリア!どの入力の組み合わせでも正しく動きます。",
@@ -193,7 +194,7 @@ export const ja: Messages = {
"half-adder": {
title: "1桁の足し算",
goal: [
- "ここからは [ON] を [1]、[OFF] を [0] と考え、表もそう書きます。すると、{A}+{B} は 0、1、2 のどれかです。2進数では、0 と 1 だけで数を書きます。ふだんの数で 9+1 が繰り上がって 10 になるように、2進数では 1+1 が繰り上がって 10 になります。そのため、0、1、2 は2桁で [00]、[01]、[10] です。2進数の1桁を「ビット」といいます。",
+ "ここからは [ON] を [1]、[OFF] を [0] と考え、課題の回路の表もそう書きます。すると、{A}+{B} は 0、1、2 のどれかです。2進数では、0 と 1 だけで数を書きます。ふだんの数で 9+1 が繰り上がって 10 になるように、2進数では 1+1 が繰り上がって 10 になります。そのため、0、1、2 は2桁で [00]、[01]、[10] です。2進数の1桁を「ビット」といいます。",
"左の桁(2の位)を {C} に、右の桁(1の位)を {S} に出しましょう。{C} を「桁上がり」、{S} を「和」といい、この回路を「半加算器」といいます。",
],
steps: [],
@@ -225,7 +226,7 @@ export const ja: Messages = {
],
steps: [
"{FlipFlop} を置きます。{FlipFlop} は、1つ前のステップで受け取った値を出します。最初のステップでは [0000] を出します。{FlipFlop} の出力を、{Count} と、右上の {7seg} につなぎます。",
- "{Const} を置きます。{Const} は、中に書いた値をいつも出します。欄の [00000000] を [0001] に書きかえて、を押します(つなぐ先の {B} に合わせて、4ビットで書きます)。欄の下の「4 ビット」は、書いた値のビット数です。",
+ "{Const} を置きます。{Const} は、欄で決めた値をいつも出します。欄の [00000000] を [0001] に書きかえて、を押します(つなぐ先の {B} に合わせて、4ビットで書きます)。欄の下の「4 ビット」は、書いた値のビット数です。",
"「{4桁の足し算}」を置き、{FlipFlop} の出力を {A} に、{Const} を {B} に、{S} を {FlipFlop} の入力につなぎます。こうすると、{FlipFlop} が出している数に 1 を足した数が、次のステップで {FlipFlop} から出てきます。{C} は使いません。",
"再生ボタンを押し、右の矢印でステップを進めます。を押すと、1秒に1ステップずつひとりでに進みます。右上の {Display} に 0 から F が順に出れば、うまく動いています。",
],