M♪o 之學習筆記本《卯》基件︰【䷗】正言若反

派生碼訊

卯 兔

老子《道德經》第四十章

反者道之動,
弱者道之用。
天下萬物生于有,
有生于無。

︰《 易 》易曰︰復:亨。 出入無疾,朋來無咎。 反復其道,七日來復,利有攸往 。彖曰:復亨﹔剛反,動而以順行,是以出入無疾,朋來無咎。 反復其道,七日來復,天行也。 利有攸往,剛長也。 復其見天地之心乎?象曰:雷在地中,復﹔先王以至日閉關,商旅不行,后不省方。

 

派︰《 λ 運算︰概念導引之《補充》※真假祇是個選擇?? 》文中講︰作者不知義大利羅馬的『真理之口』將會如何來決定『何謂是真 ?』而『什麼又是假』的呢??

又為什麼『』與『』的 λ表達式是

TRUE =_{df} (\lambda  x. ( \lambda y. x))
FALSE =_{df} (\lambda  x .( \lambda y. y))

的呢?如果我們將『運算』看成『黑箱』,用『實驗』的方法來『研究』輸入輸出的『關係』,這一組有兩個輸入端的黑箱,對於任意的輸入『二元組』pair  (u, v),有︰

(((\lambda x. ( \lambda y. x)) u) v) = u
(((\lambda x. ( \lambda y. y)) u) v) = v

,於是將結論歸結成︰貼『』標籤的箱子的『作用』是『選擇』輸入的『第一項』將之輸出;而貼『』標籤的箱子的『作用』是『選擇』輸入的『第二項』將之輸出。

假使一位『軟體』工程師在函式『除錯』時,可能會採取在那個『函式』內『輸出』看看得到的『輸入』參數值是否正確?

於是將結論歸結成︰』標識符的函式『作用』是『選擇』輸入參數的『第一項』;『』標識符的函式『作用』是『選擇』輸入參數的『第二項』。

那麼對一個已經打開的『白箱』,又知道作用的『函式』,怎麼會概念上『一頭霧水』的呢??如果細思一個邱奇自然數『 0 』, 0 =_{df} (\lambda f. ( \lambda x. x)),這跟『』的 λ表達式有什麼不一樣的呢?那難道我們能說『0』就是『』的嗎?在《布林代數》中的『0』與『1』其實是未定義的『兩態』基元概念── 就像歐式幾何學裡的『』、『』和『』是『基本』概念一樣 ──,因此不管說它是『電壓高低』或者講它是『電流有無』的『數位設計』可以應用布林代數。要是我們將『0』『1』與『』『』概念連繫起來看,『布林邏輯』就是『真假』是什麼的『系統化』之概念內涵開展,它的『整體內容』呈現『兩態邏輯』的『方方面面』,縱使至於『孤虛』NAND 一個邏輯概念就足夠了,對於『 0 與 1 』概念本身還是『三緘其口』。……

『孤虛者』有言︰

物有無者,非真假也。苟日新,日日新,又日新。真假者,物之論也。論也者,當或不當而已矣。故世有孤虛者,言有孤虛論。

可以『中行獨復,以從道也。』,不至『迷復,凶』矣!

試問彼此井通,『彼』之『出』為『此』之『入』;『此』之『出』為『彼』之『入』。若以『此』觀『出入』者,實乃『彼』之『入出』也。故知所謂『出入』,相對『己我』所定之『名義』 ,存立論之所也。因而推知『有無』者『天地』之『然或不然』;『真假』者『理則』之『當或不當』。倘將『有無』匹配『真假 』,終有『正反』兩說,『正言正說』── 真有,假無 ── 以及『正言若反』── 真無,假有 ── ,各站其『立場』者耶!!

 

生 ︰《 網 》網上說︰

Design How-To

Logic 101 – Part 2 – Positive vs Negative Logic

Clive Maxfield
11/21/2006 04:00 AM EST

The terms positive logic and negative logic refer to two conventions that dictate the relationship between logical values and the physical voltages used to represent them. Unfortunately, although the core concepts are relatively simple, fully comprehending all of the implications associated with these conventions requires an exercise in lateral thinking sufficient to make even the strongest amongst us break down and weep!

Before plunging into the fray, it is important to understand that logic 0 and logic 1 are always equivalent to the Boolean logic concepts of False and True, respectively (unless you’re really taking a walk on the wild side, in which case all bets are off). The reason these terms are used interchangeably is that digital functions can be considered to represent either logical or arithmetic operations (Fig 1).

 


1. Logical versus arithmetic views of a digital function.
Having said this, it is generally preferable to employ a single consistent format to cover both cases, and it is easier to view logical operations in terms of “0s” and “1s” than it is to view arithmetic operations in terms of “Fs” and “Ts”. The key point to remember as we go forward is that logic 0 and logic 1 are logical concepts that have no direct relationship to any physical values.

Physical-to-abstract mapping (NMOS logic)
OK, let’s gird up our loins and meander our way through the morass one step at a time. The process of relating logical values to physical voltages begins by defining the frames of reference to be used. One absolute frame of reference is provided by truth tables, which are always associated with specific functions (Fig 2).

 


2. Absolute relationships between truth tables and functions.
Another absolute frame of reference is found in the physical world, where specific voltage levels applied to the inputs of a digital function cause corresponding voltage responses on the outputs. These relationships can also be represented in truth table form. Consider a logic gate constructed using only NMOS transistors (Fig 3).

 


3. The physical mapping of an NMOS logic gate.
With NMOS transistors connected as shown in Fig 3, an input connected to the more negative Vss turns that transistor OFF, and an input connected to the more positive Vdd turns that transistor ON. The final step is to define the mapping between the physical and abstract worlds; either 0v is mapped to False and +ve is mapped to True, or vice versa (Fig 4).

 


4. The physical to abstract mapping of an NMOS logic gate.
Using the positive logic convention, the more positive potential is considered to represent True and the more negative potential is considered to represent False (hence, positive logic is also known as positive-true). By comparison, using the negative logic convention, the more negative potential is considered to represent True and the more positive potential is considered to represent False (hence, negative logic is also known as negative-true). Thus, this circuit may be considered to be performing either a NAND function in positive logic or a NOR function in negative logic. (Are we having fun yet?)

 

△ 細讀

樹莓派 SAKS 擴展板上手把玩 之 絢麗的流水燈
,方知實習 機 機板,是『負邏輯』且四顆藍色 LED 與四位數碼管之位選針『共用』。無怪乎!☹ 昨兒覺的莫名其妙!!☿☺

 

碼 ︰無 習 。考試中。

行 ︰好不容易才知道,怎能不嘗試一下的嘛!☺☿

 

root@raspberrypi:/home/pi# python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> GPIO.setmode(GPIO.BCM)
>>> 
# 選取負邏輯
>>> 四位數碼管位選一 = 17
>>> 四位數碼管位選二 = 27
>>> 四位數碼管位選三 = 22
>>> 四位數碼管位選四 = 10
>>> 位選關 = GPIO.HIGH
>>> 藍一LED = 5
>>> LED亮 = GPIO.LOW
>>> LED滅 = GPIO.HIGH

# 方將設定 GPIO.OUT,□ 就亮,雖然文件有『初始值』設法,卻錯過!
# 後讀《樹莓派 SAKS 擴展板上手把玩 之 絢麗的流水燈》,始知情。
# 又憶 Python 線上幫手︰
>>> help(GPIO.setup)
# Help on built-in function setup in module RPi.GPIO:

#  setup(...)
#  Set up a GPIO channel or list of channels with a 
# direction and (optional) pull/up down control

# channel - either board pin number or BCM number
# depending on which mode is set.

# direction - IN or OUT
# [pull_up_down] - PUD_OFF (default), PUD_UP or PUD_DOWN
# [initial] - Initial value for an output channel
# (END)

# 故可如此賦值
>>> GPIO.setup(四位數碼管位選一, GPIO.OUT, initial=位選關)
>>> GPIO.setup(四位數碼管位選二, GPIO.OUT, initial=位選關)
>>> GPIO.setup(四位數碼管位選三, GPIO.OUT, initial=位選關)
>>> GPIO.setup(四位數碼管位選四, GPIO.OUT, initial=位選關)
>>> GPIO.setup(藍一LED, GPIO.OUT, initial=LED滅)
>>> 
# 一償昨日之願
>>> GPIO.output(藍一LED, LED亮)
>>> GPIO.output(藍一LED, LED滅)

 

訊 ︰☿ 瀏覽與精讀實在兩回事,今後務必用心兼得。