Lecture 6: SWITCH LOGIC Biên soạn:Th.S Bùi Quốc Bảo (Base on Floyd, Pearson Ed.) CuuDuongThanCong.com https://fb.com/tailieudientucntt SWITCHES A B A B + 5V - + 5V - C IF switches A AND B AND C are closed THEN light is on A IF switch is closed THEN light is on CuuDuongThanCong.com B + 5V - C IF switches A OR B OR C are closed THEN light is on https://fb.com/tailieudientucntt A Good Connection (A wire) B A A No Connection (Open) B Poor Connection (Resistor) B Consider these combinations: +5V None 0V Good wins over None 0V 0V Poor Poor A +5V +5V +5V +5V Good +5V C B None 0V Poor wins over None CuuDuongThanCong.com +5V 0V Good 0V Good wins over Poor Don’t this! https://fb.com/tailieudientucntt CONTROL SWITCH Control A simple on/off switch with control A B Threshold If Control is > 2.5V, switch is closed otherwise, switch is open Note: Assume switches are always closed with higher voltage, open with lower voltage CuuDuongThanCong.com https://fb.com/tailieudientucntt MẠCH ĐIỆN DÙNG SWITCH 5V 5V Vout=0 Vout Vin Vin=5 GND = 0V Vin 0V 5V switch Vout open 5V closed 0V CuuDuongThanCong.com 5V Vout=5 Vin=0 GND = 0V Inverter GND = 0V Vin Vout https://fb.com/tailieudientucntt DÙNG OUTPUT LÀM INPUT VCC=5V Vmid Vout Vin 0V 5V Vin Vmid Vin Vin CuuDuongThanCong.com Vmid 5V 0V Vout 0V 5V Vout Vout Buffer https://fb.com/tailieudientucntt VCC Vout VA VB VA 0V 0V 5V 5V VB 0V 5V 0V 5V Vout 5V 5V 5V 0V A B C NAND gate Vout is 0V only if VA AND VB are both 5V A B A B C AND gate CuuDuongThanCong.com https://fb.com/tailieudientucntt C VCC L = 0V, H = 5V A L L H H C A B B L H L H A B C H L L L NOR gate C is L if A OR B is H A B C A B C OR gate CuuDuongThanCong.com C https://fb.com/tailieudientucntt