Thursday, 19 March 2015

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

Tuesday, 17 March 2015

Kernels are just a code.

Learn variety of interupt and registers.

Directive, instruction, labels

Function (this just an excerpt)
1. Register set
1.1 Register set to a constant
1.2 Register set to 0
1.3 Register set to 255

2. Copy
2.1 Copy register to register
2.2 Copy SRAM to register, directly
2.3 SRAM register
2.4 SRAM to register and INC
2.5 DEC, SRAM to register
2.6 SRAM, displaced to register
2.7 Port to Register
2.8 Stack to register
2.9 etc...

3. Add
3.1 Add 8 bit + 1
3.2 Add 8 bit, for example: add r1, r2
3.3 8 bit + carry
3.4 etc...

4. Substract
4.1 8 bit -1, for example: DEC r1
4.2 8 bit, for example: SUB r1, r2
4.3 8 bit, constant, SUBI rh, c255
4.4 etc

5 Shift
5.1 Shift logic left
5.2 Shift logic right

6. Binary
6.1 Binary And, for example: AND r1, r2
6.2 Binary Or, for example OR r1, r2
6.3 Binary Exclusive-OR, for example: EOR r1, r2
6.4 Ones-complement, for example: COM r1
6.5 Twos-complement: NEG r1

7. Bits change
7.1 Register, set
7.2 Register, clear

8. Status bit set
8.1 Zero flag
8.2 Carry flag
8.3 Negative flag

9. Status bit clear
9.1 Zero f

10. Compare
10.1 Compare register to register, for example: CP r1, r2
10.2 Register, Register + carry, for example: CPC r1, r2

11. Immediate jump
11.1 Relative
11.2

12. Conditional jump
12. Jump if status bit set
12.2 Jump if status bit clear, for example: BRBC b7, c127
12.3 Jump if equal, for example: BREQ c127

13. Conditioned jump
13.1 Register bit = 0, for example: SBRC r1, b7

14. Others
14.1 NOP = no operation
14.2 Sleep = Sleep
14.3 Watchdog reset = WDR




Pseudocode to solve total resistance count function

For instance:
R1, (R2 // R3)

1. Solve the paralel first with formula:
1/Rt = (R2 x R3) / (R3 + R3)
2. Find Rt = 1/...
3. And then add to R1
4. End
 
1. First law: inertia
Sebuah bola kasti yang dilemparkan secara garis lurus di atmosfir bumi / di luar angkasa ke arah matahari, akan terus bergerak dengan kecepatan konstan jika tidak ada force yang mengungguli / force yang melebih force yang melempar bola kasti tersebut.

A moving object will continue moving in a straight line at a constant speed, and a stationery object will remain at rest, unless acted upon by an unbalanced force.

2. Second law: the "F=m x a"
The acceleration produced by a force on an object is proportional to the magnitude of the force, and inversely proportional to the mass of the object.

3. Third law: For every action there is an equal and opposite reaction.
 


Properti fisika

Mass/Thing/Benda
- Center of mass
- Dimension of the mass
- Berat jenis of the mass
- Volume of the mass
- Kelenturan of the mass
- Berat of the mass


Water(air)
- freezing point