text stringlengths 59 71.4k |
|---|
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const double PI = 2.0 * acos(0.0); const double EPS = 1e-6; int a[455]; int b[455]; vector<int> G[455]; int boss[455]; void init() { for (int i = 1; i < 455; i++) boss[i] = i; } int find_boss(int x) { return boss[x] = (boss[x] == x ? x : find_bos... |
/* ****************************************************************************
This Source Code Form is subject to the terms of the
Open Hardware Description License, v. 1.0. If a copy
of the OHDL was not distributed with this file, You
can obtain one at http://juliusbaxter.net/ohdl/ohdl.txt
Description: RF... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; const long long M = 1e9 + 7; const double pi = acos(-1); long long dp[1000006]; int main() { long long n; cin >> n; long long a[n + 1]; memset(dp, 0, sizeof(dp)); dp[0] = 1; for (long long i = 1; i <= n; i++) { cin >> a[i]; vect... |
#include <bits/stdc++.h> using namespace std; const int OO = (int)2e9 + 5; const int MOD = (int)1e9 + 7; const long double Pi = 3.141592653589793238; const int N = (int)2e5 + 5; long long qqaGJJ[N], ss[2][N], vRI[2][N], n, uVyh = 0; int main() { cin >> n; for (int i = (int)(1); i <= (int)(n); i++)... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (n % 2 == 0) { cout << n / 2 << n ; } else { cout << int(n / 2) + 1 << n ; } } } |
#include <bits/stdc++.h> using namespace std; void DFS(int s); vector<int> v[60]; int d = 0; int c[200]; int main() { int n, m; scanf( %d %d , &n, &m); for (int i = 0; i <= 50; i++) v[i].clear(); memset(c, 0, sizeof(c)); for (int i = 1; i <= m; i++) { int u, vv; scanf( %d %d ... |
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2014 Francis Bruno, All Rights Reserved
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foun... |
#include <bits/stdc++.h> using namespace std; int a[102]; int main() { int n, i, l, r, j; char name[100009]; cin >> n; scanf( %s , name); l = 0; r = 9; for (i = 0; i < n; i++) { if (name[i] == L ) for (j = 0; j < 10; j++) if (a[j] == 0) { a[j] = 1; ... |
#include <bits/stdc++.h> using namespace std; const int M = 1000000007; const int MM = 998244353; const long double PI = acos(-1); const long long INF = 2e18; template <typename T, typename T1> void amax(T &a, T1 b) { if (b > a) a = b; } template <typename T, typename T1> void amin(T &a, T1 b) {... |
#include <bits/stdc++.h> using namespace std; struct vt { int p; int a; int b; }; int main() { int n, index; cin >> n; int a[n + 5], b[200005]; for (int i = 1; i < 200005; i++) { b[i] = 0; } int maxd = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; b[a[i... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Sun Apr 09 07:02:45 2017
// Host : GILAMONSTER running 64-bit major release (... |
module sdram_fsm (
input wr_en,
input rd_en,
input [31:0] data,
input [31:0] addr,
output data
// SDRAM control signals
output reg [ 1:0] sdClkE,
output reg sdWeN,
output reg sdCasN,
output reg sdRasN,
output reg sdCsN,
output reg [11:0]... |
`timescale 1ns / 1ps
module VGA_ctrl
(
input clk,
input [2:0] d_in,
output [2:0] rgb,
output Hs,
output Vs,
input VGA_en,
// For debug purposes
output[9:0] H_count,
output[9:0] V_count,
output clk_25,
output D_En
);
wire[9:0] H_cnt;
wire[9:0] V_cnt;
wire V_cnt_en;
// ... |
`timescale 1ns/1ns
//-----------------------------------------------------------------------------
// Copyright (C) 2009 OutputLogic.com
// This source file may be used and distributed without restriction
// provided that this copyright statement is not removed from the file
// and that any derivative work contains ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 100005; int a[MAXN], b[MAXN], c[MAXN]; int tb[MAXN]; int d, n; long long x; long long getNextX() { x = (x * 37 + 10007) % 1000000007; return x; } void initAB() { for (int i = 0; i < n; i = i + 1) { a[i] = i + 1; } ... |
typedef struct packed {
logic [7:0] data;
logic wr_ena;
} mystruct_s;
module submod
(input logic a_port,
input logic [4:0] b_bus,
input mystruct_s single_struct_is_fine,
input mystruct_s [2:0] array_of_struct_is_not,
output logic status);
/*AUTOTIEOFF*/
... |
`timescale 1ns / 1ps
`include "cache_defines.vh"
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:21:06 03/12/2015
// Design Name: cache
// Module Name: D:/Modelsim Projects/Xilinx/cache_implementation/cacheblock2_tb.v
// Project Name... |
#include <bits/stdc++.h> inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } inline void sub(long long &a, long long b) { a -= b; if (a < 0) a += 1000000007; } inline void add(long long &a, long long b) { a += b; if (a >= 1000000007) a -= 1000000007; } template <... |
#include <bits/stdc++.h> using namespace std; string s; int main() { cin >> s; long long mid; for (long long i = 0; i < s.size(); i++) { if (s[i] == ^ ) { mid = i; break; } } long long sum = 0; for (long long i = 0; i < s.size(); i++) { if (s[i] == = ||... |
#include <bits/stdc++.h> using namespace std; int num[300005]; long long dp[300005], ans = -LONG_LONG_MAX; vector<int> G[300005]; int cnt = 0; void dfs(int now, int fa) { for (int k : G[now]) { if (k != fa) { dfs(k, now); dp[now] += max((long long)0, dp[k]); } } ans =... |
/*****************************************************************************
* *
* Module: Altera_UP_Avalon_Audio *
* Description: *
... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2005 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
reg a; initial a = 1'b1;
reg b_f... |
//PS2 mouse controller.
//This module decodes the standard 3 byte packet of an PS/2 compatible 2 or 3 button mouse, or alternatively, if an intellimouse is detected, a 4-byte packet is supported with scrollwheel support.
//The module also automatically handles power-up initailzation of the mouse.
module userio_ps2mou... |
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 2e5 + 123; int a[N]; vector<int> g[N]; int n, node, stdist = 0; void dfs(int k, int par, int dist) { if (dist > stdist) { node = k; stdist = dist; } for (auto it : g[k]) { if (it == par) continu... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 00:45:31 11/23/2014
// Design Name: ssg_display
// Module Name: /home/aneez/workspace/vSevenSegmentDisplay/ssg_display_tb.v
// Project Name: vSevenSegmentDisplay
// ... |
//------------------------------------------------------------------------------
//
// Copyright 2011, Benjamin Gelb. All Rights Reserved.
// See LICENSE file for copying permission.
//
//------------------------------------------------------------------------------
//
// Author: Ben Gelb ()
//
// Brief Description:
//... |
// (C) 2001-2019 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions and other
// software and tools, and its AMPP partner logic functions, and any output
// files from any of the foregoing (including device programming or simulation
// files), and any associated ... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2011(c) Analog Devices, Inc.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// a... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { int n; string input, temp; bool f1, f2; cin >> n; getline(cin, input); for (int i = 0; i < n; i++) { f1 = false; f2 = false; getline(cin, input); if (input.length() > 4) { temp = input.substr(0, 5); ... |
#include <bits/stdc++.h> using namespace std; int main() { char ch; int state = 0; while ((ch = cin.get()) != EOF) switch (state) { case 0: if (isdigit(ch)) { cout << ch; state = 1; } if (ch == , ) { cout << ch; state... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; string input() { int n; string sequence; cin >> n >> sequence; return sequence; } int getMaxBalance(const string &sequence) { int balance = 0; int maxBalance = 0; for (char bracket : sequence) { balance += (bracket == [ ) - (bracke... |
#include <bits/stdc++.h> using namespace std; long long f[1 << 10], M = 1000000; long long l, r, k; class Matrix { public: long long a[3][3]; Matrix(int fib = 0) { memset(a, 0, sizeof(a)); if (fib) a[1][2] = a[2][1] = a[2][2] = 1; } Matrix operator*(const Matrix &v) { Matrix... |
/*
* This demonstrates a basic dynamic array
*/
module main;
byte foo[];
int idx;
initial begin
if (foo.size() != 0) begin
$display("FAILED -- foo.size()=%0d, s.b. 0", foo.size());
$finish;
end
foo = new[10];
if (foo.size() != 10) begin
$display("FAILED -- foo.size()=%0d, s.... |
//*****************************************************************************
// (c) Copyright 2009 - 2013 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
/... |
// lint_checking MODLNM OFF
module autoasciienum_onehot (
input clk,
input rst_n,
output ack
);
localparam // synopsys enum state_info
IDLE = 0,
S1 = 1,
... |
module RegisterFileTestBench2;
parameter sim_time = 750*2; // Num of Cycles * 2
reg [31:0] in,Pcin;
reg [19:0] RSLCT;
reg Clk, RESET, LOADPC, LOAD,IR_CU;
wire [31:0] Rn,Rm,Rs,PCout;
//RegisterFile(input [31:0] in,Pcin,input [19:0] RSLCT,input Clk, RESET, LOADPC, LOAD,IR_CU, output [31:0] Rn,Rm,Rs,PCout);
RegisterFil... |
#include <bits/stdc++.h> using namespace std; namespace variables { struct triple { long long first, second, third; }; } // namespace variables using namespace variables; void testt(); namespace andu2006 { void debug(set<long long> _var, string _name = ) { cerr << Debug #set << _name << ... |
#include <bits/stdc++.h> using namespace std; long long n, l, r; long long gerar(long long n) { if (n == 0) { return 0; } return 2 * gerar(n / 2) + 1; } long long solve(long long esq, long long dir, long long l, long long r, long long valor) { long long mid = (esq + dir... |
#include <bits/stdc++.h> using namespace std; int main() { int a[3010], x, y, c[100], d[100], n, l, r, time, count = 0, p, q, i, j; scanf( %d%d%d%d , &p, &q, &l, &r); memset(a, 0, sizeof(a)); while (p--) { scanf( %d%d , &x, &y); for (i = x; i <= y; i++) a[i]++; } for (i = 0; i < ... |
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } long long n; long long b[200005]; long long cnt[65]; vector<long long> vec, vec2; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n; ... |
#include <bits/stdc++.h> using namespace std; int main() { int k, n[3], t[3]; while (scanf( %d , &k) == 1) { for (int i = 0; i < 3; i++) scanf( %d , &n[i]); for (int i = 0; i < 3; i++) scanf( %d , &t[i]); deque<int> q[3]; for (int i = 0; i < 3; i++) q[i].clear(); int p = 0; ... |
// dig
/*
-------------------------------------------------------------------------------
Copyright 2014 Parallax Inc.
This file is part of the hardware description for the Propeller 1 Design.
The Propeller 1 Design is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
`begin_keywords "1364-2005"
/*
* Copyright (c) 2005 Stephen Williams ()
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the Lice... |
//-----------------------------------------------------------------------------
//
// (c) Copyright 2008, 2009 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information of Xilinx, Inc.
// and is protected under U.S. and international copyright and other
// intellectual pr... |
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; for (int i = 0, c = 2 % n; i < n - 1; i++, c = (c + i + 1) % n) { if (c) cout << c << ; else cout << n << endl; } cout << endl; return 0; } |
#include <bits/stdc++.h> using namespace std; const int inf = 0x3f3f3f3f; const int mo = 1000000007; inline void gn(long long &x) { int sg = 1; char c; while (((c = getchar()) < 0 || c > 9 ) && c != - ) ; c == - ? (sg = -1, x = 0) : (x = c - 0 ); while ((c = getchar()) >= 0 &&... |
// megafunction wizard: %ROM: 1-PORT%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: Apod.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// =======================... |
#include <bits/stdc++.h> using namespace std; char str[200005]; int arr[200005]; int cum[200005]; int main() { scanf( %s , &str); int n = strlen(str); int q, idx; scanf( %d , &q); while (q--) { scanf( %d , &idx); int l = idx, r = n - idx + 1; arr[l]++; arr[r + 1]--;... |
module merge_step(X9,Y9,b,X17,Y17,clk);
`define WIDTH 22
input clk;
input [`WIDTH-1:0] X9;
input [`WIDTH-1:0] Y9;
input [7:0] b;
output reg [`WIDTH-1:0] X17;
output reg [`WIDTH-1:0] Y17;
wire [`WIDTH-1:0] tmpX10;
wire [`WIDTH-1:0] tmpX11;
wire [`WIDTH-1:0] tmpX12;
wire [`WIDTH-1:0] tmpX13;
wire [`WIDTH-1:0] tmp... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; const long long inf = 3e18; long long t, a[maxn], b[maxn], x[maxn]; long long l[maxn], r[maxn]; int n; int main() { scanf( %d%lld , &n, &t); for (int i = 1; i <= n; i++) scanf( %lld , a + i); for (int i = 1; i <= n; i++) s... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2009 Xilinx, Inc.
// All Right Reserved.
///////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ Version : 11.... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 00:38:23 04/26/2015
// Design Name:
// Module Name: register_file
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies: ... |
#include <bits/stdc++.h> using namespace std; void reset(int& n, int first) { n = n & ~(1 << first); } bool check(int n, int first) { return (bool)(n & (1 << first)); } set<int> ax, ay; multiset<int> bx, by; set<int>::iterator l, r; int main() { int i, j, k, n, w, h; while (scanf( %d%d%d , &w, &h,... |
/*
File: earb.v
This file is part of the Parallella Project.
Copyright (C) 2014 Adapteva, Inc.
Contributed by Fred Huettig <>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either v... |
#include <bits/stdc++.h> using namespace std; mt19937 rnd(time(0)); const long long inf = 0x3f3f3f3f3f3f3f3fLL; const long long N = 35; const long long MOD = 1e9 + 7; long long n, u, r, ans = -inf; long long a[N], b[N], k[N], p[N], dp[N][N]; void go(long long pos, long long lst) { if ((u - pos) % 2 ... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
#include <bits/stdc++.h> using namespace std; signed main() { long long n; cin >> n; vector<long long> left; vector<long long> right; long long ok = 0; for (long long i = 0; i < n; i++) { string s; cin >> s; long long l = 0, r = 0; for (auto it : s) { if (it =... |
#include <bits/stdc++.h> using namespace std; int main() { int n, temp; cin >> n; vector<int> num; while (n != 0) { cin >> temp; num.push_back(temp); n--; } sort(num.begin(), num.end()); int smallest = 1; for (int i = 0; i < num.size(); i++) { if (smallest != ... |
//*****************************************************************************
// (c) Copyright 2008-2009 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// ... |
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int vis[26], cnt[26], h[26]; set<int> e[26]; vector<string> S[1005]; int mp[26]; bool operator<=(string a, string b) { for (int i = 0; i < min(a.size(), b.size()); i++) { if (a[i] == b[i]) continue;... |
/*
* DE0Nano_Button.v
*
* ___ _ _ _ _ ___ _ _ ___
* | __._ _ _| |_ ___ _| |_| |___ _| | . | \ |_ _|
* | _>| ' ' | . / ._/ . / . / ._/ . | | || |
* |___|_|_|_|___\___\___\___\___\___|_|_|_\_||_|
*
*
* Created on : 20/06/2015
* Author : Ernesto Andres Rincon Cruz
* Web : ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/*******************************************************************************
* This file is owned and controlled by Xilinx and must be used *
* solely for design, simulation, implementation and creation of *
* design files limited to Xilinx devices or technologies. Use ... |
#include <bits/stdc++.h> using namespace std; const int INF = 1e9 + 96; const int MAXN = 1e6 + 5; const int MAXK = 8e6 + 5; const int MOD = 1e9 + 7; const int MAX_ASCII_CODE = 26; const int MAX_NUMBER_OF_NODES = 1e5 + 5; int n, m; int arr[MAXN]; int rea[MAXK]; int foo(int v) { if (v == 0) retu... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Mon Jan 23 19:11:23 MST 2017
// Date : Tue Oct 17 02:50:46 2017
// Host : Juice-Laptop running 64-bit major release ... |
#include <bits/stdc++.h> using namespace std; const int maxN = 1000 * 1000 + 50; vector<int> v[maxN]; int cnt; bool mark[maxN]; void dfs(int s) { mark[s] = 1; cnt++; for (int i = 0; i < v[s].size(); i++) if (mark[v[s][i]] == 0) dfs(v[s][i]); } int main() { int n, m, k, sum = 0, com... |
// This module will display the input values on the DE0 GPIO BOARD
// It requires the DE0 CLOCK_50 signal to be connected to it's clock input
// all other inputs can just use whatever data should be displayed.
// The one output, GPIO_0, should be connected to GPIO0_D (all 32 bits are used)
// This module works by s... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.4
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1 ns / 1 ps
m... |
#include <bits/stdc++.h> using namespace std; const int N = 10005, M = 105; int n; char s[N]; int p, m; int lim; int dp[2][N][M]; int ch[N][2], tot = 1; int fa[N]; void dfs(int u) { if (!ch[u][0]) return; dfs(ch[u][0]); dfs(ch[u][1]); for (int i = 0; i <= lim; i++) for (int j =... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
`timescale 1ns / 1ps
`default_nettype none //To avoid bugs involving implicit nets
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Acknowledgements: Prof. Kyle Gilsdorf (Arizona State)
// - http://www.public.asu.edu/~kyle135/
// -
//
//
//... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
This file is part of Fusion-Core-ISA.
Fusion-Core-ISA is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fusion-Core-... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
* This module handles duration of note, style of play (i.e. normal, staccato or slurred) and BPM control.
*/
module timing_controller (CLK, BPM, MODE, NOTE, START, EN, DONE);
input CLK; // 100 MHz clock
input [1:0] MODE; // Note style
input [3:0] NOTE; // Note type, e.g. crotchet
input STA... |
#include <bits/stdc++.h> using namespace std; int main() { map<string, int> mp; vector<string> vec; string s; int n, m, v; double k; cin >> n >> m >> k; for (int i = 0; i < n; i++) { cin >> s >> v; if (v >= 100) { mp[s] = k * v + 1e-9; if (mp[s] >= 100) ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: Tecnológico de Costa Rica
// Engineer: Juan José Rojas Salazar
//
// Create Date: 30.07.2016 10:22:05
// Design Name:
// Module Name: LINEALIZADOR_NORMALIZADOR
// Project Name:
// Target Devices:
//... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995-2013 Xilinx, Inc. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// ____ ____
// / /\/ /
// /___/ \ / Vendor: Xilinx
// \ \ \/ Version : ... |
module testbench;
localparam integer PERIOD = 12000000 / 9600;
// reg clk = 0;
// initial #10 forever #5 clk = ~clk;
reg clk;
always #5 clk = (clk === 1'b0);
reg RX = 1;
wire TX;
wire LED1;
wire LED2;
wire LED3;
wire LED4;
wire LED5;
top uut (
.clk (clk ),
.RX (RX ),
.TX (TX ),
.LED1(LED1),... |
#include <bits/stdc++.h> using namespace std; const int maxn = 2e3 + 5; int a[maxn][maxn]; int col[maxn]; int deg[maxn]; bool vis[maxn]; int n; void recurse() { int piv = -1; for (int i = 1; i <= n; i++) { if (vis[i]) continue; if (deg[i] % 2 == 1) { piv = i; break; ... |
//*****************************************************************************
// (c) Copyright 2008-2009 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// ... |
#include <bits/stdc++.h> using namespace std; using lli = long long int; using pii = pair<int, int>; using vi = vector<int>; using vb = vector<bool>; using vvi = vector<vector<int>>; using vlli = vector<long long int>; using vpii = vector<pair<int, int>>; int main() { ios_base::sync_with_stdio(fal... |
#include <bits/stdc++.h> using namespace std; int inp[105][105]; int a[105]; int b[105]; int temp[105]; int main() { int n, m; scanf( %d , &n); scanf( %d , &m); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) scanf( %d , &inp[i][j]); for (int i = 0; i < m; i++) b[i] = inp[0... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; struct SquareMatrix { SquareMatrix(int _n) : n(_n) { data.assign(_n, vector<long long>(_n, 0)); } vector<long long> &operator[](int i) { return data[i]; } const vector<long long> &operator[](int i) const { return data[i]; } ... |
#include <bits/stdc++.h> using namespace std; inline int read() { char c = getchar(); int x = 0, f = 1; for (; !isdigit(c); c = getchar()) if (c == - ) f = -1; for (; isdigit(c); c = getchar()) x = x * 10 + c - 0 ; return x * f; } const int MAXN = 8e3 + 5; int nxt[MAXN], p[MAXN][MA... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 03:54:36 07/21/2013
// Design Name: dsha_finisher
// Module Name: C:/Dropbox/bc/fpga/test/dsha_finisher.v
// Project Name: processor
// Target Device:
// Tool vers... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { int n, v = 0, p = 0; string s, result = ; cin >> n >> s; v = (n - 11) / 2; p = v; for (int i = 0; i < n; i++) { if (s[i] == 8 ) { if (v > 0) v--; else result += s[i]; } else { ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 7; const int MOD = 1e9 + 7; int n; int h[MAXN]; int main() { int m, k, ta, tb; scanf( %d%d%d , &n, &m, &k); for (int i = 1; i <= m; i++) { scanf( %d , &ta); h[ta] = 1; } int cur = 1; if (!h[cur]) f... |
//
// bsg_tag_client
//
// simple serial on-chip configuration network
//
//
// 8/30/2016
//
// RESET SEMANTICS
//
// * NORMAL USAGE
//
// 0. wire bsg_tag_i.en high
// 1. assert reset on the send side of the module for at least one cycle (via bsg_tag_i)
// 2. clock the send side for one cycle.
// 3. clock the recv sid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.