Categories
Uncategorized

Revealing Redstone

Acknowledgments

What is Redstone? What is a Language?

Unavoidable History

What is an Argument (Made of Statements)?

Logical Turing Arguments (P, R, Therefore Q)

Truth Tables

Boolean Logic Gates and Symbols

Circuits and Sub-Circuits

Let’s Build a Computer! Part 1

Half-Adders

Full-Adders

Multiplexers

Let’s Build a Computer! Part 2

Memory: Random Access vs Permanent

Latches and Registers

7-Segment Displays

Putting It All Together!

Acknowledgments (This would not be possible without):

  1. The unlimited patience and enthusiasm offered by friends!
  2. YouTube Personalities: CNB, MumboJumbo
  3. YouTube Educators: Carrie Ann(Crash Course), Computer Science Channel
  4. Sequential Logic on YouTube
  5. https://en.wikipedia.org/wiki/Computer

What is Redstone? What is a Language?

Redstone is a metallic ore block found in the sandbox-adventure game, Minecraft (Mojang). When retrieved, its conductive dust can be placed on flat ground (With RedPower2 Mod (covered later), this restriction doesn’t apply!) to make electronic circuits. This dust can also be combined with other materials in a Crafting Bench to make elaborate tools! The possibilities are endless!

When utilized to its utmost potential, Redstone becomes a platform for your imagination! Mechanical elements, such as lockable doors, keypads, even whole computers are at your grasp, and that’s not the end of it!

Redstone, in a loose sense, can be thought of as a language. What do I mean by this? Cultural and historical facts: yes. Intricate grammatical vocabularies: definitely. But don’t pick up these lessons and expect to speak French! It isn’t like that!

In the effort to understand computers and their applications, think of a language more mechanically. It has letters and words, which interact with each other grammatically to form sentences. A computer, however advanced, only understands two “letters”: 1 and 0. From this, it can make a vast assortment of “words” called Binary, which will come up later.

Unavoidable History

Computers have come a long way. The word itself originates from the Latin “putare”, which means “to think” (Science is the study of “knowing”, from the Latin “scire”). Some early examples of this, of course, include the Chinese abacus, Greek orerry, and European counting house.

It wasn’t until the Babbage family came around that the world would have a concept of programmable technology. Due to the extreme cost of this analog device in the pre-industrial era, the production was shut down. However, this advanced machine would pave the way for the future.

Alan Turing was the next in line, with the idea of Turing-compliancy. A machine is said to be compliant if it can recognize and cogitate new information beyond its base formatting. All universal coding languages are compliant in this manner in that they can be given instructions called Flags, which are an advanced topic.

The ENIAC (after the Colossus), was the first fully-successful Turing-compliant machine. It could read 5000 instructions a second (enough to print ~20 words) and took up a whole room with monitors. Nowadays, computations that would normally require NASA-level applications are public-use and accessible via smartphone!

What is an Argument (Made of Statements)?

To begin our understanding of computers, we must comprehend logic. Logic (from Greek “logos”, “to study”) is the application of knowledge to virtually everything. Biology, Criminology, Psychology, Endocrinology…are all derivatives of this. Logical thinkers are like detectives. They discover clues and follow patterns to make assessments called Arguments (which have nothing to do with actual conflict).

Argumentative Statements describe the world around us. Statements are made up of different parts. Premises are the facts – and only the facts! Conclusions can be thought of as a mathematical “result” which depends on the Premises.

“It is cold” and “It is wet” are factual premises that could be said on a rainy or snowy day. Based on this evidence, what would you say if you didn’t have an umbrella?

A logical result of “not carrying an umbrella” (another premise), might be “I am drenched and unhappy”!

If you do in fact carry an umbrella, then you could say contrarily “I am dry and happy”!

Logical Turing Arguments

These logical patterns are the basis of everything. Being able to think critically opens doors in your everyday life. When you see these patterns, you might stop and consider how they affect other things, like a Butterfly Effect. Turing Arguments are essential in the following chapters.

It is rather unwieldly to think of Arguments in terms of human sentences, regardless of the language. We won’t immediately be able to see the connections unless we boil it all down in a process called Abstraction!

Instead of using sentences, let’s use single letters. When declaring that something is true, we can simply substitute “P” for Premise and “Q” for Conclusion. If there are multiple Premises, use other letters.

In the previous example, we said,

“If it is raining, it is cold”.

We can shorten this to If P Then Q

The statement “If, Then” is a pattern you will see a lot. This is a Conditional Statement or Rule.

When the first line “If P Then Q” is asked, we are simply making a generalization. We might not know whether it will rain, but will have the general idea that rain is indeed cold. In the second line, we state the facts. Maybe today it isn’t raining. Then we would say “Not P”.

Usually, in logic, this would be read as P’, which is just another way to save time. The tilde after P means “opposite”.

Now we can gather the stated information and make our Conclusion.

Based on our intelligence, we can make an educated guess that “It’s not cold if it isn’t raining”.

In this case, we can simply say Q’. This is read “Q prime”. In other words, it might be warm, it might be hot, heck – it might be literally raining cats and dogs – but it is not cold!

In recap, we will designate longer sentences into letters to make our assumptions. Using Conditional Statements, we can find out the truth.

P -> Q, P’, Q’

Truth Tables

N

ow that we know how to read and understand simple logical statements, we need a way to organize data more cohesively. How do we do this? Let’s put it in perspective.

When you use a calculator, you automatically know that the addition sign adds numbers together and gives you the result. You don’t need to think about it in terms of “one hundred plus two hundred is three hundred”. You simply know the shorthand.

What we are trying to do with abstraction is think of bigger ideas in smaller packages. We accomplish this with Truth Tables.

Let’s look at the original example in terms of P and Q, except we will keep the conditional rule as an afterthought.

If -> Then, Else

P -> Q, Q’

Now, instead of letters, let’s think of it in terms of electric information (Binary).

If -> Then, Else

0 -> 1, 0 (If 0 Then 1, Otherwise 0)

We have made our first step towards logic! How great!

More simply, this can be written

0/1/0

1/0/1 (and the opposite is true, as well!)

Boolean Logic Gates and Symbols

If you have followed thus far, you are ready to begin the hands-on component of Redstone! The notations you see above are called gates, which are symbols used to represent the abstraction of bigger projects. Each of these gates follows a conditional rule. The three most important gates are AND, OR, and NOT. We have already explored NOT in detail. NOT is the inverse of If, Then… In the case that a statement cannot be applied to If, Then…then we look to the Else clause which mandates that we do the opposite.

In brief, whatever is not applied to NOT becomes True, and whatever is applied becomes False. In shorthand, just draw a triangle with a dot to signify that you are passing the opposite!

Here is the Truth Table for NOT (which was seen in the last chapter!)

P/Q

0/1

1/0

The Truth Table for OR (R is a second Premise)

P/R/Q

0/0/0

1/0/1

0/1/1

1/1/1

AND is more complex. It mandates that both inputs be True, lest it become False.

Truth Table for AND

PRQ

000

100

010

111

Other gates are possible as you can see. NAND is simply an inversion of AND.

NAND

001

100

010

110

Circuits and Sub-Circuits

A circuit is defined as a group of gates with a specific function. They can range from the smallest of circuits to a whole CPU. When we combine circuits into more abstract blocks, it is easier to acknowledge them as sub-circuits. To draw a sub-circuit, the notation is generally a square with a notch in the top. This notch designates the north heading of the sub-circuit, in which case other components must be oriented in the same direction. As we progress through more advanced components, it becomes necessary to acknowledge sub-circuits as part of a bigger sub-circuit! This is another level of abstraction!

Let’s Build a Computer! Part 1

A computer, as we have discussed, is very powerful. A smartphone of today has more processing ability than Houston’s command center did during the Apollo Eleven flight.

How is this possible? Well, let’s start by identifying the components of a computer. Forgetting the software (a later topic), the hardware is made up of three parts: the Arithmetic Logic Unit (ALU), the Random Access Memory (RAM), and the Control Processing Unit (CPU).

In this section, I will be talking about the ALU. This component is responsible for executing mathematical operations in the computer. Just as we learned that 1 + 1 = 2, the ALU breaks down logical information (bits) into useful information.

The ALU is actually very simple, foregoing the need for OP Codes, which can be addressed later. An AND gate and an XOR (exclusive OR) gate are the main components of the ALU.

When a status signal is passed into the circuit, it tells the ALU to compare the A and B integers. If either integer input is passed, the integer output is passed. However, if both integers are passed, then the Status signal is carried onward. In other words, when Status is True, this is circuit has the following Logic Table:

In(A) In(B) Out Carry

0 0 0 0

1 0 1 0

0 1 1 0

1 1 0 1

Essentially, as you might have figured out, the ALU is additive like an AND gate, with an added benefit. The Carry output is known as Overflow. By feeding this line into an identical ALU circuit, the result is a called Ripple Carry Addition RCA.

But RCA is incredibly slow, taking exponentially longer increments in order to process. But there is a solution to this: Carry-Look-Ahead Addition CLA. This new, improved form works by introducing Generate statements, G = A * B (Generative lines carry inward), and

Propagate statements P = A + B (Propagation lines carry outward).

We can evaluate this in a conditional statement: C1 = G0 + P0 * C0

As such, C2 = G1 + P1 * C1…and so on.

With these first two statements, we can combine C1 to produce a new equation:

C2 = G1 + G0 * P1 + C0 * P0 * P1

A partial CLA

Of course, we can expand this!

When we see compare the CLA Full Adder to the RCA Fuller, we notice several things. First, it is bigger, and bigger means 1) more expense, and 2) more integral heat. But we aren’t really worried with this so much because we are solving the issue of speed!

Leave a comment