Computer architecture

-6

Assuming a basic video game consisting of a processor and memory to store the game processing and joystick input requests, and that ALU is able to add up to three different joystick input requirements. The table below shows the binary encodings without each joystick request.

Requisição Código Requisição Código
Up 0010101 A 1001010
Down 1010101 B 1110101
Left 1101010 C 1001001
Right 0011101 Start 0010110

a) How much should the ALU (variable width w) be to support joystick requests in order to there is no overflow. The table below shows the non-flagged binary encodings of each joystick.

b) As a way to reduce costs with the production of a processor with less capacity arithmetic, ie, 7 bits, explain technically, what would be the practical result in the game, if the player to make a combination that causes an overflow. Discuss.

    
asked by anonymous 07.05.2018 / 18:53

1 answer

0

a) 9 bits, which is the sum of the 3 largest values = 1 0011 0100

b) There are some matches in the sum of three entries, for example:

      0 0001 0101 + 0 0100 1010 + 0 0101 0101 = 
    = 0 0001 0110 + 0 0100 1001 + 0 0101 0101 = 0 1011 0100

discarding overflow and using only the 7 bits: 011 0100

In addition, the sum of the UP, START and C keys will result in the B key being pressed alone.

result: with 7 bits or 9 bits the sum of the keys is not a good alternative, because there is a coincidence in the result of some combinations.

    
08.05.2018 / 18:58