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"