How do computers work? Redstone CPU tutorial for beginners [No.1 – Computer Composition, Binary and Logic Gates]
Include picture/forms cited from Minecraft Wiki, licensed under CC-BY-SA 3.0.
In this series of articles, the author will assume that the reader already understand the basic operation of the redstone system, such as redstone signal can be passed up to 15 blocks, redstone repeater can extend the signal / create a delay ranging from 1-4 redstone tics. These contents can be studied in the relevant entries of the Minecraft Wiki.
English version

As one of the highest selling games in the world, minecraft has a countless number of famous ways to play. One of the most talked about ways to play is with redstone circuits. It simplifies the operation and greatly lowers the threshold of production while retaining the basic principles of logic circuits, allowing players to build devices like building blocks.

Have you ever wondered how a modern computer works? If you want to get a clear understanding of the underlying principles of how computers work, building a working CPU with your own hands is certainly an excellent way to do so. This blog post will be divided into four chapters, with step-by-step breakdowns and explanations of the principles to help readers build a real working Redstone computer.

Composition of a computer

Before we can build a computer, we need to know what parts a computer is made of. A computer has five basic components: arithmetic unit, controller,memory, input device, and output device.

Let’s take a simple math problem as an example. Suppose our computer wants to add two numbers and print them. First the input device inputs the three numbers and puts them into memory; secondly, it calls the operator to get the two numbers from memory, add them and store the result back into memory. Finally, the output device is called, and the output device prints the number in the memory. Throughout the process the controller is responsible for making each component work in turn and regulating where the data goes.

However, CPU is not as conscious as people, and the way they operate is simply the very basic physical laws. To understand this, let’s first simplify the problem, and then simplify it again, until it can’t be any simpler – binary.

Binary – the beginning of all

In the physical world 0 and 1 are very simple things. We can use a high voltage for on, or 1, and a low voltage for off, or 0. We can use a switch to control the on/off of a circuit.

Just like base 10 positional notation, binary can represent numbers as well. In decimal, if a number is larger than the largest number 9, we make the first digit carry to the next, writing 10. In binary, if there are only two numbers, 0 and 1, we write the third value into the next digit, as 10.

Using the number 712 as an example, the hundreds place represents how many 100s there are in the number, and the tens place represents how many 10s there are in the number. 10 tens is 100, and 10 (10 x 10) is 1000. or we can write it another way: 10^2 is 100, and 10^3 is 1000.

So, decimal(base 10) 712 is equivalent to 7 10^2,1 10^1, plus 2.

The same goes for binary. The tens place represents how many 2’s there are, and the hundreds place represents how many 2 (2s).

So complicated, I don’t want to nest, so let’s use powers. The tens place in binary represents how many 2^1, the hundreds place represents how many 2^2, and the thousands place represents how many 2^3. So how do you convert binary to decimal?

Cited from Zhihu @fangfang

Very simple! So how do you convert base 10 numbers to binary?

The base 10 number will keep dividing by 2 until the end of the division, place the remainders produced by the process together to get your result. It’s quite straight forward, isn’t it? Curious readers can stop and think about how this works.

Try this: represent a number in Minecraft by the brightness of the redstone, for example 13 in decimal (1101 in binary).
How to convert decimal numbers quickly? Open the calculator in Windows 10, and switch to the “Programmer” mode.

Logic Gates and Boolean Operations

After we learn to represent numbers, let’s try to calculate something! Assuming that 1 is true and 0 is false, then we can have the following operations:

NOT: !A. !1=0, ! 0=1. Always the opposite.

AND:A∧B. Result is 1 only if all inputs are 1.

OR:A∨B Result is 1 if any input is 1.

Let’s try to represent the result of the operation in a table. Let’s use A, B to represent the input and C to represent the output. We call such a table a truth table.

For example, the truth table with the OR gate is

A B C
000
010
100
111

How do you use these logic gates in Minecraft? Try the magic redstone torches! A lit redstone torch will go out when it is charged by a redstone wire, puller, or other power source. So we can build a non-gate, as shown in the figure.

Similarly, we can also build AND gates and OR gates. Try these in the game.

There may be many different types of logic gates, but most are based on the three most basic ones above – NOT, AND and OR. One example is the NOR gate. An NOR gate is true only when both inputs are false, and it actually inverts the output of the ragular OR gate. an or gate followed by a non gate! The output of an NAND (not-and, not the chips inside your SSD) gate is exact the opposite of an AND gate – this can be achieved by simply connecting a NOT gate after the AND gate.

The table below lists the types of logic gates and a description of their functions. The first two rows show all possible input combinations, and the bottom shows the output of the corresponding logic gate at the corresponding input combination. You can click on the links to go to the wiki to read a detailed description of that logic gate. There you can also find the structure of these gates in minecraft.

Don’t be frightened by this long list; remember, only the three most common logic gates are used in most of the time.

AONONoffoffQuestion Answered
BONoffONoff
A AND BONoffoffoffAre both inputs on?
NOT (A IMPLIES B)offONoffoffIs A on and B off?
NOT (B IMPLIES A)offoffONoffIs B on and A off?
A NOR BoffoffoffONAre both inputs off?
AONONoffoffA
A XOR BoffONONoffAre the inputs different?
NOT AoffoffONONIs A off?
A XNOR BONoffoffONAre the inputs the same?
BONoffONoffB
NOT BoffONoffONIs B off?
A NAND BoffONONONIs either input off?
A IMPLIES BONoffONONIf A is on, is B also on?
B IMPLIES AONONoffONIf B is on, is A also on?
A OR BONONONoffIs either input on?
Try it out
Build an AND gate circuit, an OR circuit, and an XOR circuit in Minecraft, and test if the inputs and outputs are as expected.
If you can’t build it, you can refer to the links in the table above. Wiki gives quite detailed drawings and explanations!
https://ltyxh.com/en/redstone-cpu-2/

Comments

  1. Likai
    3 years ago
    2021-10-18 12:50:28

Send Comment Edit Comment


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
洛天依九周年
颜文字
Emoji
小恐龙
花!
Previous
Next