LEGO Engineering

| | | | | | | |
How do I do algebra with containers?


22nd of April, 2010

(3 )
100% thumbs up 0% thumbs down

There are many available functions to do simple operations to containers. The following multiplies the value of the blue container by five. This means that there needs to be a value in the blue container already.

algebra_containers_pic_1.jpg


You can also use the values of other containers. For example, the following divides the blue container by the value of the red container:

algebra_containers_pic_2.jpg


There are many other functions to do basic algebra with container values, all of which can be found in the container section of the functions pallet.
 


The AND and OR functions are slightly more complex. Both functions look at the bit code of the numerical values and compare them with the wired-in value.  With AND, there has to be a one (the "true" value) in both slots for there to be a one in the resulting bit code. After the computation, the bit code is converted back into a numeric value and placed into the wired-in container. 

The AND operator yields 01 (true) if and only if both values in the function are 01:

01 AND 01 yields 01
00 AND 01 yields 00
00 AND 00 yields 00

The OR operator yields 01 (true) if and only if one or more of the values in the function are 01:

01 OR 01 yields 01
00 OR 01 yields 01.
 
00 OR 00 yields 00

The other way to do algebra with containers involves using the formula container; please see the question entitled "How to use the formula container".





AG
ses
kw
   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.