- Xanh da trai, xanh la, den, nhO vang.
1. Cae ham logic cd blm
Trang d~i s6 logic co cae ham logic co ban nhu saU:
1,1, Ham AND (ham nMn logic)
Ham g6m 2 bien VaG 1ft Xl va X2- M6i quan h¢ giUa ham va bien duqc bieu
dien nhu sau : F (x) = Xl • X2
Bien va ham trong d~i s6logic chi nh~n hai gia tIi 1ft 0 va 1, vi v~y v6i ham AND ta co gia trj ham theo gia trj bien nhu sau:
x]=O, x2=Otaco f(Xt,X2)=X].X2=O.O=O
XI = 0, X2 = 1 ta co f (XI. X2) = Xl • X2 = O. 1 = 0 XI = 1, X2 = 0 ta co f (XI' x2) ::. XI . X2 = 1. 0 = 0
Xl = 1, X2= I ta co f(xl , x2) = Xl' X2 = 1.1 =1
Nhu v~y ham AND chi co gia tri bfing 1 khi ta't cii dc bien cua ham co gia tri bang 1.
1.2. Ham OR (ham cong logic)
Ham gam hai bien vao Xl va x2. M6i quan h~ giiia ham va bien duqc bieu dien nhu sau:
f(xJ = Xl + x2 C\l the: Neu Xl = 0, X2 = 0 ta co f (X;) = Xl + X2 = 0 Nell Xl = 0, X2 = I la co r (Xi) = Xl + X2 = 1 Neu XI = 1, Xl = 0 ta co f (X,) = Xl + x2 = 1 Neu XI = 1, X2 = ila co [(Xl) = XI + x 2 = I
Ham OR chi co gia tri bang 0 khi tfit d. cae bien vao deu bang O.
1..1. lIam NOT (ham dao logic)
HAm co m¢t bien vao. M6i quan h¢ giiIa ham va bien dutlc bi~u di~n nhu sau:
f(x) = x
C~ th~ x = 0 thi f(x) = I
x = I thi f(x) = 0
TlT ba ham C(j ban tren ta co them d.c ham hai bien vao sau:
- Ham NAND con g9i la ham "Vil dao". Gia tr! cua ham bang gia tri dao cua
hiimAND.
- Ham NOR con g9i la ham "c(mg diio". Gii tr! ella ham bang gia tf! dao cua
ham OR.