240 likes | 334 Views
The (5) Parts Every Computer MUST have. Input Devices (getting information IN). Computers. Humans. Question: What other INPUT devices can you think of?. Output Devices (getting information OUT). Computers. Humans. Question: What other OUTPUT devices can you think of?.
E N D
Input Devices (getting information IN) Computers Humans Question: What other INPUT devices can you think of?
Output Devices (getting information OUT) Computers Humans Question: What other OUTPUT devices can you think of?
Input and Output Devices Married Humans He is inputting She is outputting
Memory Devices (storing information) Computers Humans Long term Short term
CPU Devices (logic and calculator) Computers Humans
Bus (transfer of information/data) Computers Humans Question: how do you think information travels in humans? In Computers?
Alan Turing & Von Neumann 1) Input 2) Output 3) Memory 4) CPU 5) Bus • Alan Turing thought of (created the theory) a machine that would run a stored program • Von Neumann’s design defined/said: “All digital computers have the same (5) parts “
We don’t all speak the same language Spanish English “I like to feed my dog named Sir Barfs–A-Lot chocolate pretzels. Me gusta comer a mi perro llamado Barfs-A-Lot mucho chocolate pretzels.
Humans and computers don’t either Binary Java System.out.println("Hello World!"); 00110010011100010101000110100010111001010010
Humans Understand Source Code A=5 B=6 C= A + B Question: Can you guess what the Java code above does?
CPUs Understand Machine Code Binary 00110010011100010101000110100010111001010010 Question: Can you guess what the machine code above does?
So we use translators (Compilers) Machine Code is computer readable Source Code is human readable Java Development Kit Virtual Machine System.out.println("Hello World!"); 00110010011100010101000110100010111001010010
Java code is translated twice! Source Code is human readable System.out.println("Hello World!");
Java code is translated twice! Source Code is human readable System.out.println("Hello World!"); STEP #1: The JDK compiles source code into Java byte code Development Kit Byte Code is an in between state moveax, byte[ebp-4] movedx, byte[ebp-8] addeax, edx movecx, eax
Java code is translated twice! Source Code is human readable System.out.println("Hello World!"); STEP #2: The JVM translates byte code into machine code and runs the machine code STEP #1: The JDK compiles source code into Java byte code Development Kit Byte Code is an in between state moveax, byte[ebp-4] movedx, byte[ebp-8] addeax, edx movecx, eax Virtual Machine Binary Code or machine code is run by the CPU 00110010011100010101000110100010111001010010
Making Mods (you need source) Byte Code moveax, byte[ebp-4] movedx, byte[ebp-8] addeax, edx movecx, eax • You only get byte code when you buy the game • Unfortunately you need source code to make mods Question: How do you get the source from the Byte code?
De-compiler (reverse translator) Byte Code moveax, byte[ebp-4] movedx, byte[ebp-8] addeax, edx movecx, eax Source Code System.out.println("Hello World!"); Forge takes the byte code you get when you purchase Minecraft and decompiles it, and generates Minecraft source code that you can then modify
MCreator: An easy-to-use mod maker Generates Source Code for your mod
Generating a new Minecraft version Source Code for Minecraft Source Code for your mod
Generating a new Minecraft version Source Code for Minecraft Source Code for your mod Development Kit Development Kit The JDK does the following: Merges the source Creates a new Minecraft Generates the byte code New version with your Mod
Generating a new Minecraft version Source Code for Minecraft Source Code for your mod Development Kit Development Kit The JDK does the following: Merges the source Creates a new Minecraft Generates the byte code New version with your Mod The JVM does the following: Translates byte code into machine code Runs the Minecraft machine code Virtual Machine