Hello AWS

top - 19:19:15 up 3 min,  1 user,  load average: 0.71, 0.49, 0.20
Tasks: 251 total, 1 running, 250 sleeping, 0 stopped, 0 zombie
Cpu0 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu4 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu5 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu6 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu7 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu8 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu9 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu10 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu11 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu12 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu13 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu14 : 0.0%us, 0.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, 0.0%si, 0.0%st
Cpu30 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu31 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu32 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu33 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu34 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu35 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 61836764k total, 912776k used, 60923988k free, 19992k buffers
Swap: 0k total, 0k used, 0k free, 598004k cached

PIC Gem Blink


LIST P=10F200
#include p10f200
__CONFIG _OSC_IntRC & _WDTE_OFF & _CP_OFF & _MCLRE_OFF

ORG 0
GOTO START
; subs go here
DELAY1 CLRF TMR0
WAIT1 MOVLW .255
SUBWF TMR0,0
BTFSS STATUS,Z
GOTO WAIT1
RETLW 0
; end subs

; main
START MOVLW B'11000111' ; Wake-up on change OFF, Weak Pull-ups OFF,
; internal clock source @ Fosc/4,
; increment on low-high,
; T0 prescaler 1:256
OPTION
MOVLW B'00001000'
TRIS GPIO
NOP
NOP
LOOP BSF GPIO,0
CALL DELAY1
CALL DELAY1
BCF GPIO,0
CALL DELAY1

BSF GPIO,1
CALL DELAY1
CALL DELAY1
BCF GPIO,1
CALL DELAY1

BSF GPIO,2
CALL DELAY1
CALL DELAY1
BCF GPIO,2
CALL DELAY1

GOTO LOOP
END

RGB Clock

Arduino sketch:
#include
#include <avr/power.h>
#define PIN 8
#define NUMPIXELS 16

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
pixels.begin();
}

void loop() {
for(int k = 0;k < 49152;k++) { // 11520*3.75s = 12h
int r = (k / 4096) % 16;
int g = (k / 256) % 16;
int b = k % 16;
for(int i=0;i<NUMPIXELS;i++) {
pixels.setPixelColor(i, pixels.Color(
i==r ? 50: 0,
i==g ? 50: 0,
i==b ? 50: 0));
}
pixels.show();
delay(37.50);
}
}

debounce


l: debounce
port map (
inp => lbtn,
clk => clkdiv(16),
outp => left_r
);

entity debounce is
port (
inp : in std_logic;
clk : in std_logic;
outp : out std_logic
);
end entity;

architecture meh of debounce is
signal s1,s2,s3 : std_logic;
begin
process(clk)
begin
if rising_edge(clk) then
s1 <= inp; s2 <= s1; s3 <= s2; end if; end process; outp <= s1 and s2 and s3; end architecture;

4-4-8 Multiplier-Accumulator

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity accum is
port ( a : in std_logic_vector (3 downto 0);
b : in std_logic_vector (3 downto 0);
clk : in std_logic;
accum_out : out std_logic_vector (7 downto 0));
end accum;

architecture meh of accum is
signal a_reg : std_logic_vector (3 downto 0);
signal b_reg : std_logic_vector (3 downto 0);
signal mult_reg : std_logic_vector(7 downto 0);
signal adder_out : std_logic_vector(7 downto 0);
begin
mult_reg <= a_reg * b_reg; process(clk) begin if (rising_edge(clk)) then a_reg <= a; b_reg <= b; adder_out <= adder_out + mult_reg; end if; end process; accum_out <= adder_out; end meh;

4 bit BCD decoder

entity bin4bcd is
port ( b : in STD_LOGIC_VECTOR (3 downto 0);
p : out STD_LOGIC_VECTOR (4 downto 0));
end bin4bcd;

architecture meh of bin4bcd is

begin
process (b)
begin
case b is
when "0000" => p <= "00000"; when "0001" => p <= "00001"; when "0010" => p <= "00010"; when "0011" => p <= "00011"; when "0100" => p <= "00100"; when "0101" => p <= "00101"; when "0110" => p <= "00110"; when "0111" => p <= "00111"; when "1000" => p <= "01000"; -- 8 when "1001" => p <= "01001"; -- 9 when "1010" => p <= "10000"; -- 10 when "1011" => p <= "10001"; when "1100" => p <= "10010"; when "1101" => p <= "10011"; when "1110" => p <= "10100"; when others => p <= "10101"; -- 15 end case; end process; end meh;