Friday, 20 March 2015

Javascript application are:
1. Database-driven application
2. Animated 2D and 3D graphics
3. Create games
4. Make things happen when you click a button
5. Image galeries
6.

Start 1: Hello World
1. Create a folder call it "scripts"
2. Then outside that folder create main.js and index.html
3. 

Thursday, 19 March 2015

Apa saja sih yang bisa dibangun dengan javascript:



Javascript bisa apa saja?
1. Javascript bisa mengubah isi dari html
Misalnya:
document.getElementById("demo").innerHTML = "Hello JavaScript";

2. Javascript bisa mengubah atribut / properti html
Misalnya:

3. Javascript bisa memvalidasi data. Contoh sebagai berikut:

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Can Validate Input</h1>

<p>Please input a number between 1 and 10:</p>

<input id="numb" type="number">

<button type="button" onclick="myFunction()">Submit</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x, text;

    // Get the value of the input field with id="numb"
    x = document.getElementById("numb").value;

    // If x is Not a Number or less than one or greater than 10
    if (isNaN(x) || x < 1 || x > 10) {
        text = "Input not valid";
    } else {
        text = "Input OK";
    }
    document.getElementById("demo").innerHTML = text;
}
</script>

</body>
</html> 

Transistor Lab #2 : Counter circuit

Counting in binary is sophisticated technique hardly to figures; but I finally understand but I almost go insane, that is how transistor used to do arithmatic add between 2 bits together.

At first sight you will really hardly found the key concept. I am in electronics for 5 years, but I finally understand the key in my last year.

The hardest part of binary arithmatic (specially adding together bits) are the carry concept / mechanism.

We can just do binary arithmatic using XOR operation, but when we add 1 + 1 the result shoud be 2, but binary limited the output into 0, 1. There is no number 2. This I confuse about.

But, after reading a lots of tutorial I know now that the carry mechanism it self is using another designated circuit. So there are 2 circuit in arithmatic adder.

The carry circuit was OR circuit and the add circuit is XOR operation. So the total is 2 circuits but supplied with same two A and B input. And the output must be 2. So counting in binary need 2 output, in this case 2 LEDs.

Lets build it

First build an XOR circuit and then built the OR circuit and then connect the A, and B input and then connect the 1 LED to XOR circuit and another LED to OR circuit.









HOW can computer count binary

1. We need to know how computer add 1 bit binary


A B Out
0 0

Transistor labs: Electronic Gates

Forget about that silly litle thing. We do this begin with simple thing: "connect this and that".
We will try to build this:
1. Not gate
2. AND gates
3. OR gates
4. NAND gate
5. NOR gate

Di lab ini juga kamu akan mengetahui apa hubungan antara transistor dengan chip-chip IC dan ngapain kamu beli/nyari chip IC di toko Glodok elektronika sewaktu ingin membuat rangkaian elektronika.

Sebagai pemanasan kamu bisa menonton video berikut:


Oke?

Start:
1. A Not Gate
transistor not gate

Rangkaian not gate ini gampang dibuat. Cuma membutuhkan sebuah transistor. Letakkan out sebelum transistor atau dengan kata lain pada kaki collector dan amati out jika A diberi tegangan dan tidak diberi tegangan.

Letakkan a pada basis. Hubungkan kaki emitter pada ground.


2. An AND gate

2-input transistor and gate


Rangkaian AND gate ini gampang dibuat.



3. An OR gates
2-input transistor or gate

Yang paling rumit memang yang bagian tengah diagram. Tapi, kalau berhati-hati kita berhasil membuat rangkaian tersebut diatas breadboard kita.

1 lingkaran = 1 transistor. Jadi rangkaian terdiri dari 2 lingkaran, jadi jumlah transistor yang dibutuhkan = 2 transistor.

4. An XOR gate

exclusive-or gate equivalent

Can you define how many transistor we need to build just an XOR gate based on above?
Answer:
2 for the OR gate, 2 for the AND gate, 2 for the last NAND gate. So the total is 2+2+2 = 6 transistors.

Because its need many transistors or too complex to build, then our ancestor has think about this and introduce us to use an IC (integrated circuit); too fasten human to build such gate.

They produce IC since 1970s. Also, because they know that computers will need lots of this gates to build.


4. NAND gates
2-input transistor nand gate


Apa perbedaan dalam rangkaian AND gate dan NAND gate?
>> Simple, output dikeataskan (NAND) atau dikebawahkan (AND) atau dengan kata lain, output sebelum transistor (AND) atau sesudah transistor (NAND).

5. NOR gate
2-input transistor nor gate

Apa perbedaan dalam rangkaian OR gate dan NOR gate?
>> Simple, output dikeataskan atau dikebawahkan.


Kesimpulan :
1. Gate-gate yang tersedia and, not, or, xor, nand, nor, x-nor.
2. Untuk mengimplementasi gerbang logika juga dapat menggunakan/membeli chip IC.
3. Untuk membuat gerbang logika juga bisa dengan menggunakan switch/saklar.

Next:
1. Bagaimana membuat computer yang bisa menambah / mengaritmatika angka / number?
2. Bagaimana kalau kita membuat permainan berdasarkan transistor?

QUIZ

1. Coba hitung ada berapa gate di dalam IC kita dibawah ini; IC ini bernama/bermerek dagang: "7408 Quad 2-input AND-Gate":

7408 Quad 2-input AND Gate

:

7408 logic and gate

Yup, jawabannya 4 buah gate berjenis AND. Yup lagi, jika kamu membeli IC ini di toko elektronik apek-apek cina kamu bisa membuat 4 buah gerbang and dengan hanya 1 buah IC ini. Dibandingkan jika menggunakan


2. Coba hitung ada berapa gate OR di dalam chip IC ini; IC ini bernama/bermerek dagang: "7432 Quad 2-Input Logic OR  gate"

7432 logic or gate

Yup sama, chip ini terdapat empat gate OR.


3. Coba hutung ada berapa gate NOR di dalam IC ini; IC ini bernama/bermerek dagang: "

7402 logic nor gate
Yup, sama chip ini terdapat empat gate NOR.


Wednesday, 18 March 2015

Electronics: Measurement

1. How to calculate the voltage accross
Principe: To calculate the voltage, the multimeter must be in paralel to what it want to measure.

2. How to calculate the current through an
Principle: To calculate the current, the multimeter must be in serial to what it want to measure.


In assembly, everything is just direct access
instructions and the port table, with the words found there anything can be constructed, all in the datasheet of the processor
How the timer is started (is writing "Timer.Start(8)" somehow easier to understand than "LDI R16,0x02" and OUT TCCRO, R16")
how the timer restarted at zero ("CLR R16" and "OUT TCCR0, R16")

Four basic programs are necessary for assembly programming. These tools are:
1. The editor: Windows notepad. Tips change to Courier.
All you have to do is open a notepad, type, and save 
2. The assembler program, program that reads the text file and produces some kind of output files is calles assembler. NASM
3. The chip programming interface
4. The simulator:

The structure of an assembler program.
1. Comments.
A comments start with a semi-colon.
Put comments around all parts of the program, be it complete subroutine or a table.
2. header informations
3. code at program start, and
4. general structure of programs


The purpose of this tutorial is: How to read two user input and add it and print it to the display.

The main program always start with initialization of the stack pointer, setting registers to default values, and the init of the hardware components used.

PORTS
Ports have a fixed address