Difference between revisions of "Lab 2: Analog Sticks"
(Created page with " Analog sticks or "joysticks" are input devices that encode a direction, like in game controllers. While aircraft had originally had rudder sticks that are purely mechanical i...") |
|||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | [[File: | + | == Background == |
+ | |||
+ | Analog sticks or "joysticks" are input devices that encode a direction, like in game controllers. While aircraft had originally had rudder sticks that are purely mechanical in nature, the latest aircraft are too heavy to control via mechanical advantage alone and so such analog sticks also find use in them. | ||
+ | |||
+ | [[File:AnalogStickk.gif|frame|Some of the first most popular video games started in and with analog sticks as input, like Street Fighter or Tekken. (Source: Core-A Gaming, "The Korean Backdash")]] | ||
Knowing the direction being output by an analog stick such as U(p) D(own) L(eft) R(ight) or any combination thereof is important for a lot of things, like knowing which sprite animation to give Mario. | Knowing the direction being output by an analog stick such as U(p) D(own) L(eft) R(ight) or any combination thereof is important for a lot of things, like knowing which sprite animation to give Mario. | ||
− | [[File:MarioSprites.gif| | + | [[File:MarioSprites.gif|frame| The Mario sprite animations are simple combinational functions of the input directions]] |
However, some analog sticks, like the one that can be found in Logisim, have a different encoding that do not necessarily correspond to U/D/L/R. This is because they can encode more than just the direction but also the magnitude of the displacement along a specific direction. | However, some analog sticks, like the one that can be found in Logisim, have a different encoding that do not necessarily correspond to U/D/L/R. This is because they can encode more than just the direction but also the magnitude of the displacement along a specific direction. | ||
− | + | == Instructions == | |
Your assignment is as follows: | Your assignment is as follows: | ||
− | # Translate the encoding of the Logisim joystick into the U(p) D(own) L(eft) R(ight) encoding with a truth table. | + | # Download the '''logisim template''' in UVLe. |
+ | # Translate the encoding of the Logisim joystick '''as shown in the GIF in this page with the ABCD input order''' into the U(p) D(own) L(eft) R(ight) encoding with a truth table. | ||
# Translate the truth tables of the U/D/L/R outputs into K-Maps. | # Translate the truth tables of the U/D/L/R outputs into K-Maps. | ||
# Obtain minimal SOP and POS expressions for the U/D/L/R outputs using the K-Maps. | # Obtain minimal SOP and POS expressions for the U/D/L/R outputs using the K-Maps. | ||
+ | # Fill in the "udlrTranslation" subcircuit with a circuit that works. | ||
+ | |||
+ | Notes: | ||
+ | |||
+ | * Your actual template is the "udlrTranslation" subcircuit! You need to change into it by double-clicking the chip icon beside the name in the ''library panel''. | ||
+ | * Again, do not move any input or output pins in the udlrTranslation subcircuit. | ||
+ | * There are a bunch of impossible input combinations. Use ''don't cares'' for these. Otherwise, the circuits you create will be suboptimal and are wrong. | ||
+ | |||
+ | [[File:UdlrTranslation.gif|frame| Sample Work. ]] |
Latest revision as of 12:46, 26 February 2025
Background
Analog sticks or "joysticks" are input devices that encode a direction, like in game controllers. While aircraft had originally had rudder sticks that are purely mechanical in nature, the latest aircraft are too heavy to control via mechanical advantage alone and so such analog sticks also find use in them.
Knowing the direction being output by an analog stick such as U(p) D(own) L(eft) R(ight) or any combination thereof is important for a lot of things, like knowing which sprite animation to give Mario.
However, some analog sticks, like the one that can be found in Logisim, have a different encoding that do not necessarily correspond to U/D/L/R. This is because they can encode more than just the direction but also the magnitude of the displacement along a specific direction.
Instructions
Your assignment is as follows:
- Download the logisim template in UVLe.
- Translate the encoding of the Logisim joystick as shown in the GIF in this page with the ABCD input order into the U(p) D(own) L(eft) R(ight) encoding with a truth table.
- Translate the truth tables of the U/D/L/R outputs into K-Maps.
- Obtain minimal SOP and POS expressions for the U/D/L/R outputs using the K-Maps.
- Fill in the "udlrTranslation" subcircuit with a circuit that works.
Notes:
- Your actual template is the "udlrTranslation" subcircuit! You need to change into it by double-clicking the chip icon beside the name in the library panel.
- Again, do not move any input or output pins in the udlrTranslation subcircuit.
- There are a bunch of impossible input combinations. Use don't cares for these. Otherwise, the circuits you create will be suboptimal and are wrong.