Discussion:
Typo in sample output?
(too old to reply)
Jason Labar
2005-04-27 01:32:58 UTC
Permalink
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
ahmad faizal arif
2005-04-27 01:55:36 UTC
Permalink
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
austin dale cole
2005-04-27 02:05:54 UTC
Permalink
same prob myself
Post by ahmad faizal arif
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
Andrew O'Connell
2005-04-27 02:17:53 UTC
Permalink
he changed it to 0xFC in today's lecture during the beginning of class
Post by austin dale cole
same prob myself
Post by ahmad faizal arif
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
OSU
2005-04-27 02:27:06 UTC
Permalink
I keep getting an output of 0XFFFFFFFC instead of 0xFC. Is this supposed to
be like this?

Tim
Post by Andrew O'Connell
he changed it to 0xFC in today's lecture during the beginning of class
Post by austin dale cole
same prob myself
Post by ahmad faizal arif
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
Jason Labar
2005-04-27 02:35:04 UTC
Permalink
Thanks for the info. Somehow I missed that in class today.
Post by Andrew O'Connell
he changed it to 0xFC in today's lecture during the beginning of class
Post by austin dale cole
same prob myself
Post by ahmad faizal arif
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the sub
instruction seems to be wrong to me. You're basically doing 3 - 7 which
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing something?
When I run my program I keep getting 0xFC where I should be getting 0xFE
according to the sample output.
OSU
2005-04-27 02:43:57 UTC
Permalink
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Post by Jason Labar
Thanks for the info. Somehow I missed that in class today.
Post by Andrew O'Connell
he changed it to 0xFC in today's lecture during the beginning of class
Post by austin dale cole
same prob myself
Post by ahmad faizal arif
Yes, I had the same problem also. Could anyone care to explain?
Post by Jason Labar
Is there a typo in the sample output for lab1? The output after the
sub
Post by Andrew O'Connell
Post by austin dale cole
Post by ahmad faizal arif
Post by Jason Labar
instruction seems to be wrong to me. You're basically doing 3 - 7
which
Post by Andrew O'Connell
Post by austin dale cole
Post by ahmad faizal arif
Post by Jason Labar
equals -4, but the sample output shows 0xFE in ACC. But, 0xFE isn't -4 in
2's compliment, 0xFC is. Is this a typo, or am I just missing
something?
Post by Andrew O'Connell
Post by austin dale cole
Post by ahmad faizal arif
Post by Jason Labar
When I run my program I keep getting 0xFC where I should be getting
0xFE
Post by Andrew O'Connell
Post by austin dale cole
Post by ahmad faizal arif
Post by Jason Labar
according to the sample output.
Beth Schlomer
2005-04-27 03:17:27 UTC
Permalink
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead
of 0xFC... I've traced all my instructions and do not understand this
output either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Vincent Paulson
2005-04-27 04:24:36 UTC
Permalink
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.

Does that make sense? I'm not sure how well I explained it.

-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Beth Schlomer
2005-04-27 04:47:36 UTC
Permalink
Yes, that makes sense.. and thats what I was thinking... but.. the
sample output is just printing out OxFC and not OxFFFFFFFC... are these
equivalent or not? I'm assuming yes they are.. but.. the question would
be.. is.. whats teh difference between 0xFC and 0xFFFFFFC... most likely
an instruction... but i dont know what instruction.. and i've traced it
several times.. checked with the card..

Beth
Post by Vincent Paulson
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.
Does that make sense? I'm not sure how well I explained it.
-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Beth Schlomer
2005-04-27 04:57:41 UTC
Permalink
OH.. I figured it out.. its a sign extended number.. so you can either
extend the sign.. or extend with zeros.. thats the difference...
Post by Beth Schlomer
Yes, that makes sense.. and thats what I was thinking... but.. the
sample output is just printing out OxFC and not OxFFFFFFFC... are these
equivalent or not? I'm assuming yes they are.. but.. the question would
be.. is.. whats teh difference between 0xFC and 0xFFFFFFC... most likely
an instruction... but i dont know what instruction.. and i've traced it
several times.. checked with the card..
Beth
samy
2005-04-27 16:31:00 UTC
Permalink
how can you extend the sign or extend it with zeros?
also, do we have to turn in a flowchart or the loop design or anything
with the code?
thanks
Post by Beth Schlomer
OH.. I figured it out.. its a sign extended number.. so you can either
extend the sign.. or extend with zeros.. thats the difference...
Post by Beth Schlomer
Yes, that makes sense.. and thats what I was thinking... but.. the
sample output is just printing out OxFC and not OxFFFFFFFC... are
these equivalent or not? I'm assuming yes they are.. but.. the
question would be.. is.. whats teh difference between 0xFC and
0xFFFFFFC... most likely an instruction... but i dont know what
instruction.. and i've traced it several times.. checked with the card..
Beth
Vincent Paulson
2005-04-27 04:24:36 UTC
Permalink
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.

Does that make sense? I'm not sure how well I explained it.

-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Vincent Paulson
2005-04-27 04:24:36 UTC
Permalink
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.

Does that make sense? I'm not sure how well I explained it.

-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Vincent Paulson
2005-04-27 04:24:36 UTC
Permalink
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.

Does that make sense? I'm not sure how well I explained it.

-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Vincent Paulson
2005-04-27 04:24:36 UTC
Permalink
You're getting 0xFFFFFFC because its and 8 bit sign extended two's
complement number. So its extends the sign to the remaning bits. So 0x4 in a
8 bit sign extended two's complement number is actually 0x00000004. The
zeros represent a positive number and the F's represent a negative number.

Does that make sense? I'm not sure how well I explained it.

-Vince Paulson
I am having this as well.. I'm getting an output of 0xFFFFFFFC instead of
0xFC... I've traced all my instructions and do not understand this output
either.. ~Beth
Post by OSU
So you guys are getting an exact readout of 0xFC? I can't figure out why I
get 0xFFFFFFFC. -Tim
Loading...