安裝 Steam
登入
|
語言
簡體中文
日本語(日文)
한국어(韓文)
ไทย(泰文)
Български(保加利亞文)
Čeština(捷克文)
Dansk(丹麥文)
Deutsch(德文)
English(英文)
Español - España(西班牙文 - 西班牙)
Español - Latinoamérica(西班牙文 - 拉丁美洲)
Ελληνικά(希臘文)
Français(法文)
Italiano(義大利文)
Bahasa Indonesia(印尼語)
Magyar(匈牙利文)
Nederlands(荷蘭文)
Norsk(挪威文)
Polski(波蘭文)
Português(葡萄牙文 - 葡萄牙)
Português - Brasil(葡萄牙文 - 巴西)
Română(羅馬尼亞文)
Русский(俄文)
Suomi(芬蘭文)
Svenska(瑞典文)
Türkçe(土耳其文)
tiếng Việt(越南文)
Українська(烏克蘭文)
回報翻譯問題
You have 3 problems to solve,
"Is Zero"
"Is positive"
"Is negative"
Solving "is negative", is just a case of sampling bit 7 (128), if TRUE then negative.
Solving "is positive", is just a case of NOT "is zero" AND NOT "is negative", if TRUE then positive.
"is zero" is where I suspect your current problem resides. I suspect based on your mention of trying to use XOR that your trying to build some kind of comparison between the input value and zero?
(cue the tricky bit, give help, not the solution). If we have some input A, we can deduce that it must be zero, if and only if all of its bits are zero. If we don't care about its distance from zero, we need only see if any bit is TRUE. using OR to combine all the bits would achieve that, although you would need to invert the output to have TRUE == zero.
That's an XOR gate. "Not" the output to make a comparator, or use a NXOR gate
You can apply that logic to each bit to compare bytes.
For <0 and >=0, Bit #8 IS the indicator. If Bit #8 = 1, then val <0. If Bit #8 = 0, then value is EITHER 0 or > 0. So put a NOT gate on Bit #8 and you have the >=0 result.
For >0, I took an AND gate and just put >=0 on one input and !=0 into the other. (3rd input was the "Tell me if value is >0" from the input. )
For <=0, you can either (simple answer) OR the <0 result with the =0 result.
or - what I did - because my gates were laid out this way: I routed the "tell me if value is <=0" signal so it goes into both of the gates that give me the <0 result and the =0 result. SO the <0 gate is turned on for both "tell me if val <0" and "tell me if val <=0". And the =0 gate is turned on for both "tell me if val =0" and "tell me if val <=0"